Macro Variables

The automatic macro variables SYSDBMSG, SYSDBRC, SQLXMSG, and SQLXRC are portable, but the SAS/ACCESS engine and the Microsoft Jet Engine determine their values. Initially, the macro variables SYSDBMSG and SQLXMSG are blank, whereas SYSDBRC and SQLXRC are set to 0.
SAS/ACCESS generates several return codes and error messages while it processes your programs. This information is available to you through these SAS macro variables:
SYSDBMSG
contains Jet provider-specific error messages that are generated when you use SAS/ACCESS software to access Microsoft Access or Excel data.
SYSDBRC
contains Jet provider-specific error codes that are generated when you use SAS/ACCESS software to Microsoft Access or Excel data. Error codes that are returned are text, not numbers.
In this statement, %SUPERQ masks special characters such as &, %, and any unbalanced parentheses or quotation marks that might exist in the text stored in the SYSDBMSG macro.
%put %superq(SYSDBMSG)
These special characters can cause unpredictable results if you use this statement, so it is more advantageous to use %SUPERQ.
You can also use SYMGET to retrieve error messages:
MSG=SYMGET("SYSDBMSG");
SYMGET example:
	DATA_NULL_;
		MSG=SYMGET("SYSDBMSG");
		PUT MSG;
	RUN;
The pass-through facility generates return codes and error messages that are available to you through these SAS macro variables:
SQLXMSG
contains Jet provider-specific error messages.
SQLXRC
contains Jet provider-specific error codes.
SQLXMSG and SQLXRC can be used only with the pass-through facility. See Return Codes for additional information.
The contents of the SQLXMSG and SQLXRC macro variables can be printed in the SAS log by using the %PUT macro. SQLXMSG is reset to a blank string and SQLXRC is reset to 0 when any pass-through facility statement is executed.