Chapter Contents |
Previous |
Next |
SAS/ACCESS Software for Relational Databases: Reference |
You can use the following SAS system options when you invoke a SAS session that accesses DB2:
For example, if you submit a PROC PRINT statement that references a DB2 table, the DB2 SQL query is displayed in the SAS log. The SAS/ACCESS engine for DB2 generates the DB2 SQL query, as shown in DB2DBUG Display of DB2 SQL Queries.
libname mylib db2 ssid=db2; proc print data=mylib.staff; run; proc sql; select * from mylib.staff order by idnum; quit;
DB2DBUG Display of DB2 SQL Queries
DB2 statements that appear in the SAS log are prepared and described in order to determine whether the DB2 table exists and can be accessed.
DB2DECPT= is valid as part of the configuration file when you invoke the SAS System.
database.tablespace specifies the names of the database and tablespace.
'DATABASE database-name' specifies only the database name. Enclose the entire specification in single quotes.
You can override the DB2IN= system option with the IN= libname or data set option.
For details about how connections are managed by the SAS/ACCESS engine for DB2, see Information for the Database Administrator and Maximizing DB2 Performance.
Specify NODB2RRS, the default, to use the Call Attachment Facility (CAF). Specify DB2RRS to use the Recoverable Resource Manager Services Attachment Facility (RRSAF). For details about using RRSAF, see Recoverable Resource Management Services Attachment Facility (RRSAF).
DB2SSID= is valid in the OPTIONS statement, as part of the configuration file, and when you invoke the SAS System.
You can override the DB2SSID= system option with the SSID= LIBNAME option.
DB2UPD= is valid in the OPTIONS statement, as part of the configuration file, and when you invoke the SAS System.
Setting Your DB2 Subsystem Identifier |
To connect to DB2, a valid DB2 subsystem name must be specified in one of the following ways:
If a site does not specify a valid DB2 subsystem when accessing DB2, the following message is generated:
ERROR: Cannot connect to DB2 subsystem XXXX, rc=12, reason code = 00F30006. Refer to the Call Attachment Facility documentation for an explanation.where XXXX is the name of the subsystem to which SAS tried to connect. To find the correct value for your DB2 subsystem ID, contact your database administrator.
Capturing DB2 Return Codes Using SYSDBRC |
WARNING: Apparent symbolic reference SYSDBRC not resolved.
Use SYSDBRC for conditional post-processing. Below is an example of how to abend a job. The table DB2TEST is dropped from DB2 after the view descriptor is created, resulting in a -204 code.
data test; x=1;y=2; proc dbload dbms=db2 data=test; table=db2test; in 'database test'; load;run; proc access dbms=db2; create work.temp.access; table=user1.db2test; create work.temp.view; select all; run; proc sql; execute(drop table db2test)by db2; quit; proc print data=temp; run; data _null_; if "&sysdbrc" not in ('0','100') then do; put 'The DB2 Return Code is: ' "&sysdbrc"; abort abend; end; run;
Because the abend prevents the log from being captured, the SAS log can be captured by using the SAS system option ALTLOG. Refer to the SAS Companion for the OS/390 Environment for information on ALTLOG.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.