
230 CONNECT Statement Chapter 12
When CONNECTION=SHARED, the CONNECT statement makes one
connection to the DBMS. Only pass-through statements that use this alias
share the connection. SHARED is the default value for CONNECTION=.
In the following example, the two CONNECT statements share the same
connection to the DBMS because CONNECTION=GLOBAL. Only the first
CONNECT statement actually makes the connection to the DBMS, while the
last DISCONNECT statement is the only statement that disconnects from
the DBMS.
proc sql;
/*...SQL Pass-Through statements referring
to mydbone...*/
connect to oracle as mydbone
(user=testuser pw=testpass
path=’myorapath’
connection=global);
/*...SQL Pass-Through statements referring
to mydbtwo...*/
connect to oracle as mydbtwo
(user=testuser pw=testpass
path=’myorapath’
connection=global);
disconnect from mydbone;
disconnect from mydbtwo;
quit;
CONNECTION_GROUP=connection-group-name
specifies a connection that can be shared among several CONNECT
statements in the Pass-Through Facility.
Default value: none
By specifying the name of a connection group, you can share one DBMS
connection among several different CONNECT statements. The connection to
the DBMS can be shared only if each CONNECT statement specifies the
same CONNECTION_GROUP= value and specifies identical DBMS
connection arguments.
When CONNECTION_GROUP= is specified, it implies that the value of
the CONNECTION= option will be GLOBAL.
DBCONINIT=<’>DBMS-user-command<’>
specifies a user-defined initialization command to be executed immediately
after the connection to the DBMS.
You can specify any DBMS command that can be passed by the
SAS/ACCESS engine to the DBMS and that does not return a result set or
output parameters. The command executes immediately after the DBMS
connection is established successfully. If the command fails, a disconnect
occurs, and the CONNECT statement fails. You must specify the command as
a single, quoted string, unless it is an environment variable.
DBCONTERM=’DBMS-user-command’
specifies a user-defined termination command to be executed before the
disconnect from the DBMS that occurs with the DISCONNECT statement.
Default value: none