This section describes the LIBNAME statement that SAS/ACCESS Interface to DB2 under z/OS supports.For general information about this feature, see LIBNAME Statement for Relational Databases.
Here is the LIBNAME statement syntax for accessing DB2 under z/OS interface.
For general information about the LIBNAME statement that is not specific to SAS/ACCESS, see LIBNAME Statement in SAS Global Statements: Reference.
specifies any SAS name that serves as an alias to associate SAS with a database, schema, server, or group of tables and views.
db2specifies the SAS/ACCESS engine name for the DB2 under z/OS interface.
provides connection information and control how SAS manages the timing and concurrence of the connection to the DBMS. Here is how these options are defined.
lets you connect to a DB2 database with a user ID that is different from the default ID. The value for this option cannot exceed 8 characters. USER= is optional. If you specify USER=, you must also specify PASSWORD=. If USER= is omitted, your default user ID for your operating environment is used. If you do not specify the SCHEMA= or AUTHID= LIBNAME option, the value of the USER= option (if present) is used as the default schema. Authentication options are not checked when the LIBNAME is issued. They are checked only when a statement involving the libref is run. However, for explicit pass-through, credentials are checked immediately.
specifies the DB2 password that is associated with your DB2 user ID. PASSWORD= is optional. If you specify USER=, you must specify PASSWORD=.
maps to the location in the SYSIBM.LOCATIONS catalog in the communication database. In SAS/ACCESS Interface to DB2 under z/OS, the location is converted to the first level of a three-level table name: location.authid.table. DB2 Distributed Data Facility (DDF) Communication Database (CDB) makes the connection implicitly to the remote DB2 subsystem when DB2 receives a three-level name in an SQL statement.
LOCATION= is optional. If you omit it, SAS accesses the data from the local DB2 database unless you have specified a value for the SERVER= option. This option is not validated until you access a DB2 table. If you specify LOCATION=, you must also specify the AUTHID= option.
specifies the DB2 subsystem ID to connect to at connection time. SSID= is optional. If you omit it, SAS connects to the DB2 subsystem that is specified in the DB2SSID= SAS system option. The DB2 subsystem ID is limited to four characters. For more information, see Values.
specifies the DRDA server to which you want to connect. SERVER= lets you access DRDA resources stored at remote locations. Check with your system administrator for system names. You can connect to only one server per LIBNAME statement.
SERVER= is optional. If you omit it, you access tables from your local DB2 database unless you have specified a value for the LOCATION= LIBNAME option.
Default: none.
|
Task |
Information Resource |
|---|---|
|
Accessing a database server on Linux, UNIX, or Windows using a libref |
|
|
Setting up DB2 z/OS so that SAS can connect to the DRDA server when the SERVER= option is used |
Installation instructions for this interface |
|
Configuring SAS to use the SERVER= option |
specifies how SAS processes DBMS objects. Some LIBNAME options can enhance performance, and others determine locking or naming behavior. The following table describes the LIBNAME options for SAS/ACCESS Interface to DB2 under z/OS, with the applicable default values. This table also identifies LIBNAME options that are valid in the CONNECT statement in the SQL procedure. For details, see LIBNAME Options for Relational Databases.
|
Option |
Default Value |
Valid in CONNECT |
|---|---|---|
|
none |
|
|
|
none |
|
|
|
none |
|
|
|
your user ID |
|
|
|
SHAREDREAD |
● |
|
|
none |
● |
|
|
none |
● |
|
|
none |
● |
|
|
none |
|
|
|
DBMS |
● |
|
|
none |
|
|
|
none |
|
|
|
NO |
|
|
|
YES |
|
|
|
COMPAT |
|
|
|
THREADED_APPS,2 |
|
|
|
NO |
● |
|
|
ANY |
|
|
|
none |
|
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
NONE |
|
|
|
none |
|
|
|
NO |
|
|
|
NO |
|
|
|
1 |
● |
|
|
DB2 z/OS determines the isolation level |
|
|
|
none |
● |
|
|
ZOS |
|
|
|
NO |
● |
|
|
your user ID |
|
|
|
YES |
|
|
|
none |
|
|
|
none |
|
|
|
none |
|
|
|
DB2 z/OS determines the isolation level |
|
|
|
none |
● |
|
|
YES |
|
In this example, the
libref MYLIB uses the DB2 under z/OS interface to connect to the DB2
database that the SSID= option specifies, with a connection to the testserver remote
server.
libname mylib db2 ssid=db2
authid=myusr1 server=mysrv1;
proc print data=mylib.staff;
where state='CA';
run;