SYSMSG Function


SYSMSG Function

Returns the text of error messages or warning messages from the last data set or external file function execution

Category: SAS File I/O

Category: External Files

Syntax

SYSMSG ()

Details

SYSMSG returns the text of error messages or warning messages that are produced when a data set or external file access function encounters an error condition. If no error message is available, the returned value is blank. The internally stored error message is reset to blank after a call to SYSMSG, so subsequent calls to SYSMSG before another error condition occurs return blank values.

Example

This example uses SYSMSG to write to the SAS log the error message generated if FETCH cannot copy the next observation into the Data Set Data Vector. The return code is 0 only when a record is fetched successfully:

 %let rc=%sysfunc(fetch(&dsid));  %if &rc ne 0 %then     %put %sysfunc(sysmsg()); 

See Also

Functions:

  • 'FETCH Function' on page 523

  • 'SYSRC Function' on page 851




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net