CONNECT Service
The CONNECT service establishes the connection between your application address space and the Db2 subsystem.
After an application thread is established through a successful ACTIVATE or CREATE THREAD request, the CONNECT service can be used to connect to the target Db2 subsystem using either RRSAF or CAF as the low-level attachment to Db2. The information provided on the preceding CREATE THREAD call is used to establish the connection to Db2.
>>---CONNECT---+----------------------+--------->< | | +--THREAD(:hv_handle)--+
The CONNECT service establishes the connection between your application address space and the Db2 subsystem. The call connects the application thread established by a CREATE THREAD call to the Db2 subsystem whose name appears in the thread control block. You must provide the thread handle (returned by the ACTIVATE or CR_ THREAD call into the host variable denoted in the syntax diagram as
hv_handle
). If the THREAD keyword is not provided, then the current application thread is used for CONNECT processing. The current application thread is established by the most recently executed CREATE THREAD call or SWITCH command. For example:'CAF CONNECT THREAD(:THREAD)
Where
THREAD is a REXX variable which contains the thread handle returned by a successful
CREATE THREAD
or ACTIVATE
call.