Configuring WPS Workbench to run an Autoexec on startup - eclipse

Does anyone have any experience configuring the WPS engine to run, essentially an autoexec.sas on startup?
I cannot find any documentation on how to implement this feature for WPS. I see that they have the option available to set, but I cannot find where to put the file or what to name it.
http://www.teamwpc.co.uk/docs/WPS-Core-Quick-Ref.xls -- shows that they have the Autoexec option enabled, but when I run proc options there's no value in it.
If WPS doesn't have this working, does eclipse have the ability to run a script on startup?'
Thanks

Ah! After a little more careful googling, and some reading between lines of the google results I figured this out.
All you have to do to get the autoexec to run is name the file autoexec.sas, just as in SAS, and then place it in the root directory of the WPS workbench.

I have found that WPS mirrors the sas command. I set up a shortcut to WPS that says the same as for sas
C:\program files\...\workbench.exe -autoexec "autoexecfilename" etc>
In this I also use the "start in" to point to a directory. In my autoexec I put
libname x '.'; and that assigns the X libname to the specific directory I choose. This allows for one shortcut in each directory, and X is in THAT directory.

Related

PhpStorm Formatter failed to format the document

Similar questions have been asked, but what makes mine different is that I seem to have the configuration correct. Here is my configuration (my name has been redacted, for privacy reasons).
What I know is that my PhpStorm IDE has not been activated yet; is that required or is my configuration incorrect, despite the folder and file being at these places?
So you're trying to use PhpStorm from within VSCode to format your files. Which means: calling PhpStorm as a command-line app.
I'm pretty sure that PhpStorm has to have a valid active licence or be in the evaluation period (so it has be "activated" in some way). I remember seeing tickets with similar issue when using PhpStorm for code inspections in Continuous Integration tools.
In any case:
Check what command VSCode is trying to execute here, then open your OS console and try to run it there -- will you see any errors/warnings in the output?
If you do not see any such messages there then check the idea.log file -- the IDE will write everything there for sure.
On Windows it would normally be in the C:\Users\USERNAME\AppData\Local\JetBrains\PhpStorm2022.2\log folder (for the current 2022.2 version). Other OS / cusom location -- check https://www.jetbrains.com/help/phpstorm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#logs-directory
...or is my configuration incorrect, despite the folder and file being at these places?
As per docs the Code Style settings file can be located anywhere: it can be in the default place as well as any other as it can be passed as an argument in the command line (-s parameter). So keeping the file with Code Style settings in the VSCode extension folder is OK as long as that parameter is used.

How to use Pentaho Spoon to rename files that do not have an extension

I am new to using Pentaho Spoon. I have about 100 text files in a folder, none of which have file extensions. I have found that if I create a job and move a file, one at a time, that I can simply rename that file, adding a .txt extension to the end. What I'd like to do is create a job that goes through and renames each file and adds the .txt extension. I've tried using the regex, but can't seem to get it to work because there's no file extension.
Any help would be greatly appreciated.
It's a pretty straightforward solution but you need to use a Transformation, as Job steps won't do it, ok?
You need the following steps:
Get File Names: just add your folder and the RegExp ".*" (without the double quotes), so everything is listed. Check if it's ok with "Show filename(s)..." button.
Modified Java Script Value: declare a new_filename var concatenating the desired extension. Remember to click "Get Variables" after adding the script to output the new field.
var new_filename = filename + '.txt';
Process Files: select Operation = Move and filename/new_filename as your source/target filenames.
That's it!
Renaming a group of files is one thing I wouldn't use Kettle for. Why not let the shell do what the shell does best?
rem example for Windows CMD shell
ren absolute-path-to-folder\*. *.txt
This can be done using a Shell job entry, if you find reason to do it in Kettle at all.
I've seen "just use a shell script" answers for this before. Works great if you can guarantee you're Kettle server is on the same OS as the developer workstation. I'm in an environment where the Dev/Spoon instance is Windows, but the Prod/Kettle environment is Linux, so you can't write one script file to rule them all.
As for "Why on earth would you do this?", my scenario is an integration scenario. We're using Pentaho for Data Integration, but a different tool for Enterprise Integration. I want a Pentaho Job to produce an output file, and I want my Enterprise Integration tool to pick up the file and do something with it, but not before Pentaho is done writing the file. Renaming helps avoid a race condition when the Enterprise Integration solution recognizes the file is there, but Pentaho isn't done writing it yet.
If I could rename a set of files, for example change from test..csv.processing to test..csv, then Pentaho would create the file initially with the .processing extension, and then remove the extension once it's done. The Enterprise Integration solution that's looking for test.*.csv won't start processing the file until Pentaho renames it. Bingo, no race condition.

How to find out current directory and go to a directory in MySQL console?

I have the following instruction in I need to perform to run a web app I that have received:
"Go to the directory where the app is unpacked and type 'gradle jettyRun'."
Sounds simple enough, if you know the commands for finding out your current directory and changing it. The problem is, searching for these basic things only nets a huge amounts of irrelevant answers to much more advanced questions where the same terms are used with a slightly different meaning. So what do they exactly mean by what they say and how do I achieve that? It sound's so simple I'm almost embarrased to have to ask it, yet I'm still dumbfounded by the MySQL command line enough to have to.
This has nothing to do with the MySQL command line (>>>), or MySQL itself. This is simply saying:
Open your terminal or shell. In Windows, this is called Command Prompt.
Change the directory to where the files are located, you do this with the cd (change directory) command.
Next you simply type gradle jettyRun.

Netbeans, phpdocumentor, and custom phpdoc.dist.xml by project

I am using Netbeans 8.0.2 and phpdocumentor 2.8.2 on a windows 7 platform.
I would like to use custom phpdoc.dist.xml config files by project so I can specify framework directories and etc. to exclude from the generated doc. I also want to keep my Netbeans PHPDOC plugin config as generic as possible, without specific output directories, ignore options, config path parameters, etc., so on, so that that the config will apply to all my projects.
The phpdoc.dist.xml file works great. The doc generated is exactly what I want.
The problem or feature, and it seems to be a phpdocumentor one as it also applies from plain command line, is that the phpdoc.bat command (without a specific config parm) has to be run from the same root directory as the phpdoc.dist.xml file, or it ignores it. No problem if I'm using command line as I can change into that directory first, but I would like to use Netbeans. I have searched on this extensively and cannot find an answer.
I considered whether to modify the phpdocumentor files to insert cd /D path/to/myproject/dir to change the directory using some Netbeans variable to represent myproject/dir, but I could not find the right place in the code or the variable to use. Plus, then I'm supporting a custom mod to phpdocumentor.
I did find these directions for a PHPStorm setup, where the author specified a PHPStorm variable for the --config command line option to point to his custom phpdoc.dist.xml.
--config="$ProjectFileDir$/phpdoc.dist.xml"
If I could do the same in Netbeans like maybe "${BASE_DIR}/phpdoc.dist.xml" it would be great, but so far I haven't hit on anything Netbeans will recognize/pay attention to in the PhpDoc script: box.
I have also tried writing a wrapper .bat file to capture my own command line variable %1 and do the directory change to that before calling phpdoc.bat, but Netbeans throws and error and says that's not a valid .bat file. I cannot find any phpdocumentor parameter to configure by specific Netbeans project but the output directory. And I would prefer not to be defining a bunch of projects on subdirectories in Netbeans, just to address phpdocumentor.
Now I am out of ideas. Can anyone point me to a solution?

Specifying relative paths in SPSS 18

In SPSS 11 it was possible to specify relative paths. Example:
FILE HANDLE myfile='..\..\data\current.txt' /LRECL=533.
DATA LIST FILE=myfile /
...
This worked because apparently, SPSS 11 set the working folder to the path where the source .SPS file is saved. It seems that SPSS 18 always sets it's working folder to the installation folder of SPSS itself. Which is not at all the same thing.
Is there an option to change this behaviour? Or am I stuck with changing everything to absolute filenames?
Instead of a relative path, you could define a directory path and use it inside other file handle declarations to save typing:
FILE HANDLE directoryPath /NAME='C:\Directory\Path\' .
FILE HANDLE myFile /NAME='directoryPath/fileName.xyz' .
GET FILE='myFile' .
This will get the file: C:\Directory\Path\fileName.xyz.
The direction of the slashes may be important.
(Works in version 17)
If you use the INSERT command to run an sps file, it has an option to change the working directory to that location.
You could use the HOST command to SUBST a drive letter (on PCs) and reference everything through that.
You could define a FILE HANDLE to the common root location and use that in file references.
You could use Python programmability to find the path to the active syntax window and issue an SPSS CD command to set the backend working directory appropriately.
HTH,
Jon Peck
With Python, you can get the full path of the current syntax window (or any other one) and get its path. Using that you can issue an SPSS cd command to change the backend working directory accordingly.
If you define an environment variable, though, you can use that in file specifications within SPSS.
p.s. SPSS has an extensive set of apis and helper modules for Python (as well as for R and .NET languages). You can get information about this from SPSS Developer Central, www.spss.com/devcentral. All the language extensions are free once you have the base SPSS Statistics product.
Regards,
Jon Peck
Or use "CD" command to change your default working directory. See also:
http://www.spss-tutorials.com/change-your-working-directory/
For example, if your default directory is C:\project, then GET FILE 'data\data_file.sav'. will open data_file.sav from C:\project\data.
And then, a few minutes later, i came across this little python script from jignesh-sutar (see here: SPSS syntax - use path of the file.
With his python code you can use the path of the syntax file as starting point for all the paths in your syntax.