此 SAS 视图代码中的语法错误在哪里?

Where is the syntax error within this SAS view code?

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 语句中存在语法错误,但我找不到位置...

错误是 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.