Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 731
exhuma Avatar asked Jan 29 '26 08:01

exhuma


1 Answers

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)

like image 122
Alaska Avatar answered Jan 31 '26 04:01

Alaska



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!