-1
data work.temp work.error / view = work.temp;  
infile rawdata;  
input Xa Xb Xc;  
if Xa=. then output work.errors;  
else output work.temp;  
run;

它说 DATA 语句中存在语法错误,但我找不到在哪里...

4

1 回答 1

2

该错误是 OUTPUT 语句中的拼写错误。您正在尝试将观察结果写入ERRORS但仅定义了数据语句ERROR

这是一个奇怪的结构,不是我推荐的东西,但看起来它会起作用。当您使用视图TEMP时,它也会生成数据集ERROR

67   data x; set temp; run;

NOTE: The infile RAWDATA is:
      Filename=...

NOTE: 2 records were read from the infile RAWDATA.
      The minimum record length was 5.
      The maximum record length was 5.
NOTE: View WORK.TEMP.VIEW used (Total process time):
      real time           0.32 seconds
      cpu time            0.01 seconds

NOTE: The data set WORK.ERROR has 1 observations and 3 variables.
NOTE: There were 1 observations read from the data set WORK.TEMP.
NOTE: The data set WORK.X has 1 observations and 3 variables.
于 2016-08-10T16:39:14.320 回答