问题描述
在SPSS 11中,可以指定相对路径。示例:
In SPSS 11 it was possible to specify relative paths. Example:
FILE HANDLE myfile='..\..\data\current.txt' /LRECL=533.
DATA LIST FILE=myfile /
...
SPSS 11将工作文件夹设置为保存源 .SPS
文件的路径。看来SPSS18总是将其工作文件夹设置为SPSS本身的安装文件夹。哪个不是一回事。
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'。
FILE HANDLE directoryPath /NAME='C:\Directory\Path\' .
FILE HANDLE myFile /NAME='directoryPath/fileName.xyz' .
GET FILE='myFile' .
这将获取文件:C:\Directory\Path\fileName.xyz。
This will get the file: C:\Directory\Path\fileName.xyz.
斜杠的方向可能很重要。
The direction of the slashes may be important.
(版本17)
这篇关于指定SPSS 18中的相对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!