Behavior of the ERRORABEND system option between step boundaries


Use caution when specifying the ERRORABEND system option in an OPTIONS statement between step boundaries.

Although the ERRORABEND option is submitted in an OPTIONS statement after the submitted code that causes an error, the ERRORABEND option will still take effect on error free code that is submitted after ERRORABEND is enabled. This applies to any error that causes SAS to issue an error message.

If running interactively, SAS will abend. If running in batch, you will see the following error:

ERROR: SAS ended due to errors.
    You specified: OPTIONS ERRORABEND;. 

Following is an example to show this behavior:

data one; input y; datalines; 33 10 15 48 ; run; /*ERROR IN FOLLOWING STEP*/ proc means data=one; var x; run; /*ENABLE ERRORABEND OPTION*/ options errorabend; run; /*NO ERROR IN FOLLOWING STEP*/ proc means data=one; var y; run;

The ERRORABEND option should either be set at SAS invocation or in an OPTIONS statement at the beginning of the program.