220 System Options for Relational Databases Chapter 11
characters such as &, %, and any unbalanced parentheses or quotes that might exist in
the text stored in the SYSDBMSG macro.
%put %superq(SYSDBMSG)
These special characters can cause unpredictable results if you use the following
statement:
%put &SYSDBMSG
It is more advantageous to use %SUPERQ.
If you try to connect to Oracle and use the incorrect password, you receive the
messages shown in the following output.
Output 11.1 SAS Log for an Oracle Error
2? libname mydblib oracle user=pierre pass=paris path="orav7";
ERROR: Oracle error trying to establish connection. Oracle error is
ORA-01017: invalid username/password; logon denied
ERROR: Error in the LIBNAME or FILENAME statement.
3? %put %superq(sysdbmsg);
Oracle: ORA-01017: invalid username/passsword; logon denied
4? %put &sysdbrc;
-1017
5?
SYMGET can also be used to retrieve error messages:
msg=symget("SYSDBMSG");
For example:
data_null_;
msg=symget("SYSDBMSG");
put msg;
run;
The Pass-Through Facility generates return codes and messages that are available to
you through the following two SAS macro variables:
SQLXMSG
contains DBMS-specific error messages.
SQLXRC
contains DBMS-specific error codes.
SQLXMSG and SQLXRC can be used only with the Pass-Through Facility. See
“Return Codes” on page 228.
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.
System Options for Relational Databases
DBSRVTP and DBSLICEPARM are SAS system options for databases. SASTRACE,
SASTRACELOC, and VALIDVARNAME are SAS system options that have applications
specific to SAS/ACCESS.