219
CHAPTER
11
Macro Variables and System
Options for Relational Databases
Introduction to Macro Variables and System Options for Relational Databases
219
Macro Variables for Relational Databases
219
System Options for Relational Databases
220
Introduction to Macro Variables and System Options for Relational
Databases
This topic describes the system options and macro variables that are available to use
with SAS/ACCESS software; it describes only those components of the macro facility
that depend on the SAS/ACCESS engines. Most features of the SAS macro facility are
portable. For more information, refer to the
SAS Macro Language: Reference and the
SAS on-line Help for the macro facility.
Macro Variables for Relational Databases
The following four automatic macro variables are portable, but their values are
determined by the SAS/ACCESS engine and your DBMS. Initially, the macro variables
SYSDBMSG and SQLXMSG are blank, whereas SYSDBRC and SQLXRC are set to
0.
SAS/ACCESS generates return codes and messages that are available to you through
the following two SAS macro variables:
SYSDBMSG
contains DBMS-specific error messages that are generated when you use
SAS/ACCESS software to access your DBMS data.
SYSDBRC
contains DBMS-specific error codes that are generated when you use SAS/ACCESS
software to access your DBMS data. Error codes that are returned are text, not
numbers.
You can use these two variables anywhere while you are accessing DBMS data.
Because only one set of macro variables is provided, it is possible that, if tables from
two different DBMSs are accessed, it might not be clear from which DBMS the error
message originated. To address this problem, the name of the DBMS is inserted at the
beginning of the SYSDBMSG macro variable message or value. The contents of the
SYSDBMSG and SYSDBRC macro variables can be printed in the SAS log by using the
%PUT macro. They are reset after each SAS/ACCESS LIBNAME statement, DATA
step, or procedure is executed. In the following statement, %SUPERQ masks special