1
DATA hatco  ;
options ls=79;
options ps=60;

INFILE '~dscbms/class/dsc8450/files/hatco';
     INPUT X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14;
LABEL X1='DELIVERY SPEED'
       X2='PRICE LEVEL'
       X3='PRICE FLEXIBILITY'
       X4='MANUFACTURER IMAGE'
       X5='OVERALL SERVICE'
       X6='SALES FORCE IMAGE'
       X7='PRODUCT QUALITY'
       X8='SIZE OF FIRM'
       X9='USAGE LEVEL'
       X10='SATISFACTION LEVEL'
       X11='SPECIFICATION BUYING'
       X12='STRUCTURE OF PROCUREMENT'
       X13='TYPE OF INDUSTRY'
       X14='TYPE OF BUYING SITUATION';
Proc means;
        var x1-x14;
PROC UNIVARIATE PLOT NORMAL;
        var x1-x7 x9;

我试图在 SAS 中运行这个程序,但我得到了错误

ERROR: Physical file does not exist,
       D:\Backups\SAS\~dscbms\class\dsc8450\files\hatco.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.HATCO may be incomplete.  When this step was
         stopped there were 0 observations and 14 variables.
WARNING: Data set WORK.HATCO was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

请帮助我提前谢谢

4

2 回答 2

2

您的 SAS 安装是否在本地 (Windows) 机器上运行?
你试图访问 Unix 机器上的文件?
使用适当的文件名语句。

于 2013-10-22T12:29:37.807 回答
1

使用具有值的 xyz.txt 创建一个文件,然后在 SAS 内联代码中给出该文件的正确路径,如下所示:您的 sas 代码将是这样

DATA hatco  ;
options ls=79;
options ps=60;

INFILE 'D:/test.txt';
     INPUT X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14;
LABEL X1='DELIVERY SPEED'
       X2='PRICE LEVEL'
       X3='PRICE FLEXIBILITY'
       X4='MANUFACTURER IMAGE'
       X5='OVERALL SERVICE'
       X6='SALES FORCE IMAGE'
       X7='PRODUCT QUALITY'
       X8='SIZE OF FIRM'
       X9='USAGE LEVEL'
       X10='SATISFACTION LEVEL'
       X11='SPECIFICATION BUYING'
       X12='STRUCTURE OF PROCUREMENT'
       X13='TYPE OF INDUSTRY'
       X14='TYPE OF BUYING SITUATION';
Proc means;
        var x1-x14;
PROC UNIVARIATE PLOT NORMAL;
        var x1-x7 x9;

和 xyz.txt 这样的文件

X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14
1  2  3  4  5  6  7  8  9   10  11  12  13  14

只有在您从中获取数据或设置的文件路径中存在问题。

于 2013-11-06T04:45:49.043 回答