A SERVICE OF

logo

90 DBLIBTERM= LIBNAME Option Chapter 9
is any DBMS command that can be executed by the SAS/ACCESS engine and that
does not return a result set or output parameters.
Details
The initialization command that you select can be a script, stored procedure, or any
DBMS SQL statement that might provide additional control over the interaction
between your SAS/ACCESS interface and the DBMS.
The command executes immediately after the first DBMS connection is successfully
established. If the command fails, then a disconnect occurs and the libref is not
assigned. You must specify the command as a single, quoted string, unless it is an
environment variable.
DBLIBINIT= fails if either CONNECTION=UNIQUE or DEFER=YES, or if both of
these LIBNAME options are specified.
When multiple LIBNAME statements share a connection, the initialization command
executes only for the first LIBNAME statement, immediately after the DBMS
connection is established. (Multiple LIBNAME statements that use
CONNECTION=GLOBALREAD and identical values for CONNECTION_GROUP=,
DBCONINIT=, DBCONTERM=, DBLIBINIT=, and DBLIBTERM= options and any
DBMS connection options can share the same connection to the DBMS.)
Example
In the following example, CONNECTION=GLOBALREAD is specified in both
LIBNAME statements, but the DBLIBINIT commands are different. Therefore, the
second LIBNAME statement fails to share the same physical connection.
libname mydblib oracle user=testuser pass=testpass
connection=globalread dblibinit=’Test’;
libname mydblib2 oracle user=testuser pass=testpass
connection=globalread dblibinit=’NoTest’;
See Also
“DBLIBTERM= LIBNAME Option” on page 90
DBLIBTERM= LIBNAME Option
Specifies a user-defined termination command to be executed once, before the DBMS disconnect
that is associated with the first connection made by the LIBNAME statement or libref
Valid in: the SAS/ACCESS LIBNAME statement
DBMS support: DB2 OS/390, DB2 UNIX/PC, Informix, ODBC, OLE DB, Oracle,
Microsoft SQL Server, SYBASE, Teradata
Default value: none
Syntax
DBLIBTERM= <’>DBMS-user-command<’>