![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/b/da/bda6fccb-b246-43e7-a520-a01ed647b8cf/bda6fccb-b246-43e7-a520-a01ed647b8cf-bg5a.png)
80 CONNECTION= LIBNAME Option Chapter 9
update mydblib.tab ...
libname mydblib clear;
libname mydblib2 clear;
In the following GLOBALREAD example, the two librefs, MYDBLIB and
MYDBLIB2, share the same connection for read access because
CONNECTION=GLOBALREAD and the connection options are identical. The first
connection is used to print the data from MYDBLIB.TAB while a second connection is
made for updating MYDBLIB.TAB. The second connection is closed at the end of the
step. Note that the first connection is closed with the final LIBNAME statement.
libname mydblib oracle user=testuser /* connection 1 */
pw=testpass path=’myorapath’
connection=globalread;
libname mydblib2 oracle user=testuser
pw=testpass path=’myorapath’
connection=globalread;
proc print data=mydblib.tab ...
proc sql; /* connection 2 */
update mydblib.tab ...
libname mydblib clear; /* does not close connection 1 */
libname mydblib2 clear; /* closes connection 1 */
In the following UNIQUE example, the libref, MYDBLIB, does not establish a
connection. A connection is established in order to print the data from MYDBLIB.TAB;
that connection is closed at the end of the print procedure. Another connection is
established to updated MYDBLIB.tab; that connection is closed at the end of the PROC
SQL. The CLEAR option in the LIBNAME statement at the end of this example does
not close any connections.
libname mydblib oracle user=testuser
pw=testpass path=’myorapath’
connection=unique;
proc print data=mydblib.tab ...
proc sql;
update mydblib.tab ...
libname mydblib clear;
In the following SHARED example, DB2DATA.NEW is created in the database TEST.
Because the table DB2DATA.OLD exists in the same database, the option
CONNECTION=SHARED enables the DB2 engine to share the connection both for
reading the old table and for creating and loading the new table.
libname db2data db2 connection=shared;
data db2data.new (in = ’database test’);
set db2data.old;
run;