SYSWARNINGTEXT Automatic Macro Variable

Contains the text of the last warning message formatted for display in the SAS log.
Type: Automatic macro variable (read only)

Details

The value of SYSWARNINGTEXT is the text of the last warning message generated in the SAS log. For a list of SYSERR warnings and errors, see SYSERR Automatic Macro Variable.
Note: If the last warning message text that was generated contains an & or % and you are using the %PUT statement, you must use the %SUPERQ macro quoting function to mask the special characters to prevent further resolution of the value. The following example uses the %PUT statement and the %SUPERQ macro quoting function:
%put %superq(syswarningtext);
For more information, see %SUPERQ Function.

Example: Using SYSWARNINGTEXT

This example creates a warning message:
data NULL;
    set doesnotexist;
run;
%put &syswarningtext;
When these statements execute, the following comments are written to the SAS log:
   1  data NULL;
   2  set doesnotexist;
   ERROR: File WORK.DOESNOTEXIST.DATA does not exist.
   3  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.
   NOTE: DATA statement used (Total process time):
       real time           11.16 seconds
       cpu time            0.07 seconds
   4  %put &syswarningtext;
  The data set WORK.NULL might be incomplete.  When this step was  
  stopped there were 0 observations and 0 variables.