Chapter Contents


SAS Companion for UNIX Environments

Determining the Completion Status of a SAS Job

The exit status for the completion of a SAS job is returned in $status for the C shell, and in $? for the Bourne and Korn shells. A value of 0 indicates normal termination. You can affect the exit status code by using the ABORT statement. The ABORT statement takes an optional integer argument, n, which can range from 0 to 255.

Exit Status Code Values summarizes the values of the exit status code.

Exit Status Code Values
Condition Exit Status Code
All steps terminated normally 0
SAS System issued warning(s) 1
SAS System issued error(s) 2
User issued ABORT statement 3
User issued ABORT RETURN statement 4
User issued ABORT ABEND statement 5
User issued ABORT RETURN n statement n
User issued ABORT ABEND n statement n

If the user specifies the ERRORABEND SAS system option on the command line, and the job has errors, the exit status code is set to 5.

UNIX exit status codes are in the range 0-127. Numbers greater than 127 may not print what the user expects because the code is interpreted as a signed byte.

Chapter Contents



Top of Page

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