Previous Page | Next Page

The LIBNAME Engines

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.

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.

Previous Page | Next Page | Top of Page