Chapter Contents

Previous

Next
SAS Companion for the Microsoft Windows Environment

Return Codes and Completion Status

The return code for the completion of a SAS job is returned in the Windows batch variable, ERRORLEVEL. A value of 0 indicates normal termination. You can affect the value of ERRORLEVEL by using the ABORT statement. The ABORT statement takes an option argument, n, which is an integer. The ABORT statement also takes the RETURN ABEND argument. If you issue these statements withoug specifying n, the ERRORLEVEL variable is set to the following values:
abort; sets the ERRORLEVEL variable to 6.
abort return; sets the ERRORLEVEL variable to 7.
abort abend; sets the ERRORLEVEL variable to 8.

The n argument can range from 0 to 65,535. The ERRORLEVEL variable is used as a condition in the IF command in a Windows batch file. Refer to your Window's user's guide for more information on the ERRORLEVEL variable. Values for the ERRORLEVEL Variable summarizes the values of the ERRORLEVEL variable.

Values for the ERRORLEVEL Variable
Condition Severity Return Code Value
All steps terminated normally SUCCESS 0
SAS System issued warning(s) WARNING 4
SAS System issued error(s) ERROR 5
User issued the ABORT statement INFORMATIONAL 6
User issued the ABORT RETURN statement FATAL 7
User issued the ABORT ABEND statement FATAL 8
SAS System terminated abnormally FATAL  (table note 1)

TABLE NOTE 1:  

If the SAS System terminates abnormally, the return code value is undefined. If a GP fault occurs, then the return code value is the same as the system error code for that fault. [arrow]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.