SAS Base (15)

Which statement is true concerning the SAS automatic variable _ERROR_?

A. It cannot be used in an if/then condition.
B. It cannot be used in an assignment statement.
C. It can be put into a keep statement or keep= option.
D. It is automatically dropped.

Check Answer
Answer: D

注解:_ERROR_是DATA step中SAS生成的Automatic Variable,当程序运行正常时_ERROR_的值为0,出错时为1。_ERROR_仅在DATA step的执行过程中存在,在执行完一次DATA step输出数据时,SAS自动丢弃该变量,即输出的data set中不会出现_ERROR_这一变量。在DATA step的执行过程中,_ERROR_可以当作IF/THEN的条件,可以将其值赋给其它变量输出到data set中,但KEEP无法作用于_ERROR_。

One thought on “SAS Base (15)

Leave a Reply

Your email address will not be published. Required fields are marked *