SAS Base (18)

Which statement describes a characteristic of the SAS automatic variable _ERROR_?

A. The _ERROR_ variable maintains a count of the number of data errors in a DATA step.
B. The _ERROR_ variable is added to the program data vector and becomes part of the data set being created.
C. The _ERROR_ variable can be used in expressions in the DATA step.
D. The _ERROR_ variable contains the number of the observation that caused the data error.

Check Answer
Answer: C

注解:和SAS Base (15)类似

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_。