Where子句似乎不起作用

时间:2016-09-16 07:54:17

标签: sas

我在SAS中有以下代码,我试图获取一个数据集,其中abo_id和abo_bklantid的值不匹配。

data set_2
 set final_set;
 where abo_id != abo_bklant_id;
run;

然而,这会产生以下错误:

ERROR: Syntax error while parsing WHERE clause.
ERROR: No input data sets available for WHERE statement.
ERROR 56-185: SET is not allowed in the DATA statement when option   DATASTMTCHK=COREKEYWORDS.  Check for a missing semicolon in the 
          DATA statement, or use DATASTMTCHK=NONE.

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, 
          a missing value, INPUT, PUT.  

ERROR 76-322: Syntax error, statement will be ignored.

我出错的任何想法?

1 个答案:

答案 0 :(得分:0)

您的第一行缺少分号: - )

data set_2;  /* <<< here! */
 set final_set;
 where abo_id ne abo_bklant_id; /* <<< cannot use != in SAS */
run;

另外(信用Robert S.)!=运算符在SAS中无效。