
The LIBNAME Statement for Relational Databases CONNECTION= LIBNAME Option 79
GLOBALREAD is the default value for CONNECTION= when you specify
CONNECTION_GROUP=.
GLOBAL (This value is valid in the interfaces to DB2 OS/390, DB2 UNIX/PC, ODBC,
and Microsoft SQL Server.)
specifies that
all operations that access DBMS tables in multiple librefs share a
single connection if the following is true:
all of the participating librefs are created by LIBNAME statements that specify
identical values for the CONNECTION=, CONNECTION_GROUP=,
DBCONINIT=, DBCONTERM=, DBLIBINIT=, and DBLIBTERM= options
all of the participating librefs are created by LIBNAME statements that specify
identical values for any DBMS connection options.
One connection is shared for all tables that are referenced by any of the librefs for
which CONNECTION=GLOBAL is specified.
Use this option with caution. If READ and UPDATE connections are shared and a
commit or rollback is performed, the READ cursors might have to be resynchronized.
If the cursors are resynchronized, there is no guarantee that the new solution table
will match the original solution table that was being read.
Details
For most SAS/ACCESS interfaces, there must be a connection, also known as an attach,
to the DBMS server before any data can be accessed. Typically, each DBMS connection
has one transaction, or work unit, that is active in the connection. This transaction is
affected by any SQL commits or rollbacks that the engine performs within the
connection while executing the SAS application.
The CONNECTION= option enables you to control the number of connections, and
therefore transactions, that your SAS/ACCESS interface executes and supports for each
LIBNAME statement.
This option is supported by the SAS/ACCESS interfaces that support single
connections or multiple, simultaneous connections to the DBMS.
ODBC and Microsoft SQL Server Details: If the data source supports only one active
open cursor per connection, the default value is CONNECTION=UNIQUE; otherwise,
the default value is CONNECTION=SHAREDREAD.
Teradata Details: for channel-attached systems (MVS), the default is SHAREDREAD;
for network attached systems (UNIX and PC platforms), the default is UNIQUE
Examples
In the following SHAREDREAD example, MYDBLIB makes the first connection to
the DBMS. This connection is used to print the data from MYDBLIB.TAB. MYDBLIB2
makes the second connection to the DBMS. A third connection is used to update
MYDBLIB.TAB. The third connection is closed at the end of the PROC SQL UPDATE
statement. The first and second connections are closed with the CLEAR option.
libname mydblib oracle user=testuser /* connection 1 */
pw=testpass path=’myorapath’
connection=sharedread;
libname mydblib2 oracle user=testuser /* connection 2 */
pw=testpass path=’myorapath’
connection=sharedread;
proc print data=mydblib.tab ...
proc sql; /* connection 3 */