Automatic Macro Variables |
Type: | Automatic macro variable (read only) |
Details | |
Example | |
Using SYSERR |
Details |
You can use the value of SYSERR as a condition to determine further action to take or to decide which parts of a SAS program to execute. SYSERR is used to detect major system errors, such as out of memory or failure of the component system when used in some procedures and DATA steps. SYSERR automatic macro variable is reset at each step boundary. For the return code of a complete job, see SYSCC Automatic Macro Variable.
SYSERR can contain the following values:
The following table contains warning return codes. The codes do not indicate any specific problems. These codes are guidelines to identify the nature of a problem.
Warning Code | Description |
---|---|
108 | Problem with one or more BY groups |
112 | Error with one or more BY groups |
116 | Memory problems with one or more BY groups |
120 | I/O problems with one or more BY groups |
The following table contains error return codes. The codes do not indicate any specific problems. These codes are guidelines to identify the nature of a problem.
Example |
The example creates an error message and uses %PUT &SYSERR to write the return code number (1012) to the SAS log.
data NULL; set doesnotexist; run; %put &syserr;
The following SAS log output contains the return code number:
75 data NULL; 76 set doesnotexist; ERROR: File WORK.DOESNOTEXIST.DATA does not exist. 77 78 run; NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.NULL might be incomplete. When this step was stopped
there were 0 observations and 0 variables. WARNING: Data set WORK.NULL was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 79 80 %put &syserr; 1012
To retrieve error and warning text instead of the return code number, see SYSERRORTEXT Automatic Macro Variable and SYSWARNINGTEXT Automatic Macro Variable.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.