INQUIRE DB2CONN

Retrieves information about the connection between CICS® and DB2®.

INQUIRE DB2CONN

Read syntax diagramSkip visual syntax diagramINQUIRE DB2CONNACCOUNTREC( cvda)AUTHID( data-area)AUTHTYPE( cvda)CHANGEAGENT( cvda)CHANGEAGREL( data-area)CHANGETIME( data-area)CHANGEUSRID( data-area)COMAUTHID( data-area)COMAUTHTYPE( cvda)COMTHREADLIM( data-area)COMTHREADS( data-area)CONNECTERROR( cvda)CONNECTST( cvda)DB2GROUPID( data-area)DB2ID( data-area)DB2RELEASE( data-area)DEFINESOURCE( data-area)DEFINETIME( data-area)DROLLBACK( cvda)INSTALLAGENT( cvda)INSTALLTIME( data-area)INSTALLUSRID( data-area)MSGQUEUE1( data-area)MSGQUEUE2( data-area)MSGQUEUE3( data-area)NONTERMREL( cvda)PLAN( data-area)PLANEXITNAME( data-area)PRIORITY( cvda)PURGECYCLEM( data-area)PURGECYCLES( data-area)RESYNCMEMBER( cvda)REUSELIMIT( data-area)SIGNID( data-area)STANDBYMODE( cvda)STATSQUEUE( data-area)TCBLIMIT( data-area)TCBS( data-area)THREADERROR( cvda)THREADLIMIT( data-area)THREADS( data-area)THREADWAIT( cvda)

Conditions: NOTAUTH, NOTFND

This command is threadsafe.

Description

Use the INQUIRE DB2CONN command to inquire about attributes of the currently installed DB2CONN resource, which defines the connection to DB2.

Because there can be only one DB2CONN resource installed at a time, the name of the DB2CONN resource is not required on input.

The resource signature

You can use this command to retrieve the resource signature fields. You can use these fields to manage resources by capturing details of when the resource was defined, installed, and last changed. For more information, see Auditing resources. The resource signature fields are BUNDLE, CHANGEAGENT, CHANGEAGREL, CHANGETIME, CHANGEUSRID, DEFINESOURCE, DEFINETIME, INSTALLAGENT, INSTALLTIME, and INSTALLUSRID. See Summary of the resource signature field values for detailed information about the content of the resource signature fields.

Options

ACCOUNTREC(cvda)
Returns the minimum amount of DB2 accounting required for transactions using pool threads. The specified minimum can be exceeded as described in the following options. CVDA values are as follows:
UOW
The CICS DB2 attachment facility causes an accounting record to be produced by DB2 for each UOW, assuming that the thread is released at the end of the UOW.
TASK
The CICS DB2 attachment facility causes a minimum of one accounting record to be produced by DB2 for each CICS task.

A transaction containing multiple UOWs, assuming that the thread is released at sync point, can use a different thread for each of its UOWs. The result might be the production of an accounting record for each UOW. For example, an accounting record is produced if a thread ends after being released or if a thread is reused but the primary AUTHID is changed.

TXID
The CICS DB2 attachment facility causes an accounting record to be produced by DB2 when the transaction ID that is using the thread changes.

Because pool threads are typically used by a number of different transaction IDs, there is an increased chance that a transaction containing multiple UOWs uses a different thread for each UOW, assuming that the thread is released at sync point. In this case, an accounting record can be produced for each UOW. For example, an accounting record is produced if a thread ends after being released or if a thread is reused but the primary AUTHID is changed.

NONE
No accounting records are required for transactions using pool threads.

DB2 nevertheless produces at least one accounting record for each thread when the thread is ended. Additionally, authorization changes cause accounting records to be produced.

AUTHID(data-area)
Returns an ID to be used for security checking when using pool threads. If an AUTHID is returned, AUTHTYPE does not apply.
AUTHTYPE(cvda)
Returns the type of ID to be used for security checking when using pool threads. If an AUTHTYPE is returned, AUTHID is blank. CVDA values are as follows:
GROUP
The 8-character user ID and the connected group name are used as the authorization ID. The following table shows how these two values are interpreted by DB2.
IDs passed to DB2 How DB2 interprets values
CICS sign-on user ID (USERID) Represents the primary DB2 authorization ID.
RACF-connected group name If the RACF® list of group options is not active, DB2 uses the connected group name supplied by the CICS attachment facility as the secondary DB2 authorization ID. If the RACF list of group options is active, DB2 ignores the connected group name supplied by the CICS attachment facility, but the value appears in the DB2 list of secondary DB2 authorization IDs.

If no RACF group ID is available for this USERID, an 8-character field of blanks is passed to DB2 as the group ID.

SIGN
The SIGNID parameter of the DB2CONN is used as the resource authorization ID.
TERM
The terminal identification (four characters padded to eight) is used as an authorization ID. An authorization ID cannot be obtained in this manner if a terminal is not connected with the transaction.

If a transaction is started using a CICS command and has no terminal associated with it, do not use AUTHTYPE(TERM).

TX
The transaction identification (four characters padded to eight) is used as the authorization ID.
OPID
The user operator identification associated with the user ID, associated with the CICS transaction, is used as the authorization ID (three characters padded to eight).
USERID
The 8-character user ID associated with the CICS transaction is used as the authorization ID.

When the DB2 sample sign-on exit DSN3@.SGN is used with AUTHTYPE(USERID), the exit sends the user ID to DB2 as the primary authorization ID and the RACF group ID to DB2 as the secondary ID. When the sample sign-on exit is used, AUTHTYPE(USERID) and AUTHTYPE(GROUP) are the same.

CHANGEAGENT(cvda)
Returns a CVDA value that identifies the agent that made the last change to the resource definition. The possible values are as follows:
CREATESPI
The resource definition was last changed by an EXEC CICS CREATE command.
CSDAPI
The resource definition was last changed by a CEDA transaction or the programmable interface to DFHEDAP.
CSDBATCH
The resource definition was last changed by a DFHCSDUP job.
DREPAPI
The resource definition was last changed by a CICSPlex SM BAS API command.
CHANGEAGREL(data-area)
Returns a 4-digit number of the CICS release that was running when the resource definition was last changed.
CHANGETIME(data-area)
Returns an ABSTIME value that represents the time stamp when the resource definition was last changed. For more information about the format of the ABSTIME value, see FORMATTIME.
CHANGEUSRID(data-area)
Returns the 8-character user ID that ran the change agent.
COMAUTHID(data-area)
Returns an ID to be used for security checking when using command threads. If COMAUTHID is returned, COMAUTHTYPE is not applicable.
COMAUTHTYPE(cvda)
Returns the type of ID to be used for security checking when using command threads. If COMAUTHTYPE is returned, COMAUTHID is blank. CVDA values are as follows:
CGROUP
The 8-character user ID and the connected group name are used as the authorization ID. The following table shows how these two values are interpreted by DB2.
IDs passed to DB2 How DB2 interprets values
CICS sign-on user ID (USERID) Represents the primary DB2 authorization ID.
RACF-connected group name If the RACF list of group options is not active, DB2 uses the connected group name supplied by the CICS attachment facility as the secondary DB2 authorization ID. If the RACF list of group options is active, DB2 ignores the connected group name supplied by the CICS attachment facility, but the value appears in the DB2 list of secondary DB2 authorization IDs.

If no RACF group ID is available for this user ID, an 8 character field of blanks is passed to DB2 as the group ID.

CSIGN
The SIGNID parameter of the DB2CONN command is used as the resource authorization ID.
CTERM
The terminal identification (four characters padded to eight) is used as an authorization ID. An authorization ID cannot be obtained in this manner if a terminal is not connected with the transaction.

If a transaction is started using a CICS command and has no terminal associated with it, do not use COMAUTHTYPE(CTERM).

CTX
The transaction identification (four characters padded to eight) is used as the authorization ID.
COPID
The operator identification associated with the user ID that is associated with the CICS transaction is used as the authorization ID (three characters padded to eight).
CUSERID
The 8-character user ID associated with the CICS transaction is used as the authorization ID.

When the DB2 sample sign-on exit DSN3@.SGN is used with COMAUTHTYPE(CUSERID), the exit sends the user ID to DB2 as the primary authorization ID and the RACF group ID to DB2 as the secondary ID. When the sample sign-on exit is used, COMAUTHTYPE(CUSERID) and COMAUTHTYPE(CGROUP) are the same.

COMTHREADLIM(data-area)
Returns the current maximum number of command threads that the CICS DB2 attachment allows active before requests overflow to the pool.
COMTHREADS(data-area)
Returns the current number of active command threads.
CONNECTERROR(cvda)
If CICS is not connected to DB2 because the adapter is in standby mode, describes how this is reported back to an application that has issued a SQL request. CVDA values are as follows:
ABEND
The application is stopped with abend AEY9.
SQLCODE
The application receives a -923 SQLCODE.
CONNECTST(cvda)
Returns the status of the CICS DB2 connection. CVDA values are as follows:
CONNECTED
CICS is connected to DB2.
NOTCONNECTED
CICS is not connected to DB2.
CONNECTING
CICS is currently attempting to connect to DB2.
DISCONNING
CICS is currently disconnecting from DB2.
DB2GROUPID(data-area)
If you are using group attach, this option returns the name of a data sharing group, or subgroup, of DB2 subsystems that you have specified. CICS attempts to connect to any active member of this group. If the CICS DB2 attachment is connected, the name of the DB2 subsystem that was chosen from the group appears in the DB2ID field. If CICS is waiting to reconnect to a specific DB2 subsystem in the data sharing group, because it is holding outstanding units of work for that subsystem, the name of the specific DB2 subsystem appears in the DB2ID field, and the status CONNECTING is returned. For this situation to arise, RESYNCMEMBER(RESYNC) must be specified.
DB2ID(data-area)
If you are not using group attach, this option returns the name of the DB2 subsystem that the CICS DB2 attachment is connected to, or if the CICS DB2 attachment is not connected, the name of the DB2 subsystem that you have specified for CICS to connect to. If you are using group attach and the CICS DB2 attachment is connected, this option returns the name of the DB2 subsystem that the CICS DB2 attachment is connected to. If you are using group attach and the CICS DB2 attachment is not connected, this field is normally blank. However, if CICS is waiting to reconnect to a specific DB2 subsystem, because RESYNCMEMBER(YES) is specified and the DB2 subsystem for which CICS is holding outstanding units of work is unavailable, the command returns the DB2ID value of that subsystem with the status CONNECTING.
DB2RELEASE(data-area)
Returns a 4-character value indicating the version and release level of the DB2 subsystem to which CICS is connected. When CICS is not connected to DB2, blanks are returned.
DEFINESOURCE(data-area)
Returns the 8-character source of the resource definition. The DEFINESOURCE value depends on the CHANGEAGENT value. For more information, see Summary of the resource signature field values.
DEFINETIME(data-area)
Returns an ABSTIME value that represents the time stamp when the resource definition was created.
DROLLBACK(cvda)
Returns a value showing whether the CICS DB2 attachment is to initiate a SYNCPOINT ROLLBACK command if a transaction is selected as victim of a deadlock resolution. CVDA values are as follows:
ROLLBACK
The attachment facility issues a sync point rollback before returning control to the application. An SQL return code of -911 is returned to the program.
NOROLLBACK
The attachment facility is not to initiate a rollback for a transaction. An SQL return code of -913 is returned to the application.
INSTALLAGENT(cvda)
Returns a CVDA value that identifies the agent that installed the resource. The possible values are as follows:
CREATESPI
The resource was installed by an EXEC CICS CREATE command.
CSDAPI
The resource was installed by a CEDA transaction or the programmable interface to DFHEDAP.
GRPLIST
The resource was installed by GRPLIST INSTALL.
INSTALLTIME(data-area)
Returns an ABSTIME value that represents the time stamp when the resource was installed.
INSTALLUSRID(data-area)
Returns the 8-character user ID that installed the resource.
MSGQUEUE1(data-area)
Returns the name of the first transient data destination to which unsolicited messages from the CICS DB2 attachment are sent.
MSGQUEUE2(data-area)
Returns the name of the second transient data destination to which unsolicited messages from the CICS DB2 attachment are sent.
MSGQUEUE3(data-area)
Returns the name of the third transient data destination to which unsolicited messages from the CICS DB2 attachment are sent.
NONTERMREL(cvda)
Returns a value showing whether non-terminal transactions are to release threads for reuse at intermediate sync points. CVDA values are as follows:
RELEASE
Non-terminal transactions release threads for reuse at intermediate sync points.
NORELEASE
Non-terminal transactions do not release threads for reuse at intermediate sync points.
PLAN(data-area)
Returns the name of the plan used for the pool. If a plan name is returned, PLANEXITNAME is blank.
PLANEXITNAME(data-area)
Returns the name of the dynamic plan exit used for pool threads. If a PLANEXITNAME is returned, PLAN is blank.
PRIORITY(cvda)
Returns the priority of the pool thread TCBs relative to the CICS main TCB (QR TCB). The thread TCBs are CICS open L8 TCBs. CVDA values are as follows:
HIGH
Thread TCBs have a higher priority than the CICS QR TCB.
EQUAL
Thread TCBs have equal priority with the CICS QR TCB.
LOW
Thread TCBs have a lower priority than the CICS QR TCB.
PURGECYCLEM(data-area)
Returns the number of minutes in the protected thread purge cycle time (the number of seconds is returned by PURGECYCLES). The range for PURGECYCLEM is 0 - 59.

A protected thread is not terminated immediately when it is released. It is terminated only after two completed purge cycles, if it has not been reused in the meantime. For example, if the protected thread purge cycle is set to 30 seconds, a protected thread is purged 30 - 60 seconds after that thread is released. An unprotected thread is terminated when it is released (at sync point or end of task) if there are no other transactions waiting for a thread on that DB2ENTRY.

PURGECYCLES(data-area)
Returns the number of seconds in the protected thread purge cycle time (the number of minutes is returned by PURGECYCLEM). The range for PURGECYCLES is 0 - 59. If PURGECYCLEM is zero, the minimum value of PURGECYCLES is 5 seconds.

A protected thread is not terminated immediately when it is released. It is terminated only after two completed purge cycles, if it has not been reused in the meantime. For example, if the protected thread purge cycle is set to 30 seconds, a protected thread is purged 30 - 60 seconds after that thread is released. An unprotected thread is terminated when it is released (at sync point or end of task) if there are no other transactions waiting for a thread on that DB2ENTRY.

RESYNCMEMBER(cvda)
This option applies only if you are using group attach, and specifies the strategy that CICS adopts if outstanding units of work are being held for the last DB2 data sharing group member to which CICS was connected. (Units of work that are shunted indoubt are not included in this process, because CICS itself cannot resolve those units of work at this time. Resynchronization for those UOWs occurs when CICS has resynchronized with its remote coordinator.) CVDA values are as follows:
RESYNC
CICS connects to the same DB2 data sharing group member.
NORESYNC
CICS makes one attempt to connect to the same DB2 data sharing group member, and, if that attempt fails, CICS connects to any member of the DB2 data sharing group and issues a warning about the outstanding units of work.
NOTAPPLIC
A value of NOTAPPLIC is returned if you are not using group attach.
REUSELIMIT(data-area)
Returns a value in the range 0 - 10000 representing the maximum number of times a thread can be reused before it is terminated. The default is 1000. A value of 0 means that there is no limit on the number of times that a thread can be reused. Long-running CICS DB2 threads that are constantly being reused build up resources in DB2 that can cause storage problems.

The reuse limit applies to unprotected threads both in the pool and on a DB2ENTRY, and to protected DB2ENTRY threads.

SIGNID(data-area)
Returns the authorization ID to be used by the CICS DB2 attachment when signing on to DB2 for pool and DB2 entry threads specifying AUTHTYPE(SIGN) and command threads specifying COMAUTHTYPE(CSIGN).
STANDBYMODE(cvda)
Returns the action to be taken by the CICS DB2 attachment if DB2 is not active when an attempt is made to start the connection from CICS to DB2. CVDA values are as follows:
NOCONNECT
The CICS DB2 attachment ends.
CONNECT
The CICS DB2 attachment goes into standby mode to wait for DB2.
RECONNECT
The CICS DB2 attachment goes into standby mode and waits for DB2. After connecting to DB2, if DB2 later fails, the CICS DB2 attachment reverts to standby mode again and then reconnects to DB2 when it restarts.
STATSQUEUE(data-area)
Returns the transient data destination for CICS DB2 attachment statistics produced when the CICS DB2 attachment is shut down.
TCBLIMIT(data-area)
Returns the maximum number of TCBs that can be used to process DB2 requests. When connected to DB2 Version 5 or earlier, the CICS DB2 attachment facility creates the TCBs in the form of subtasks up to the limit specified by TCBLIMIT. Each of these subtasks identifies to DB2 and creates a connection into DB2. When connected to DB2 Version 6 or later, CICS uses open TCBs to process DB2 requests. The TCBLIMIT attribute of the DB2CONN definition governs how many of the open TCBs can be used to access DB2; that is, how many of them can identify to DB2 and create a connection into DB2.
TCBS(data-area)
Returns a number indicating the TCBs currently used by the CICS DB2 attachment facility. The number returned is the number of TCBs that are associated with DB2 connections (command, pool, or DB2ENTRY threads), so the interpretation of the number depends on the release of DB2 to which CICS is connected, as follows:
Connected to DB2 Version 5 or earlier (therefore not using the open transaction environment)
Subtask TCBs are created and managed by the CICS DB2 attachment facility to service DB2 requests, and remain permanently associated with DB2 connections (command, pool, or DB2ENTRY threads). In this case, the TCBS option returns the highwater mark of TCBs created to access DB2.
Connected to DB2 Version 6 or later (therefore using the open transaction environment)
The TCBs used by the CICS DB2 attachment facility are allocated by CICS from the pool of L8 mode TCBs. A DB2 connection is not permanently assigned to the same L8 TCB, and, between CICS tasks, it can move from one L8 mode TCB to another. In this environment, the TCBS option returns the number of L8 mode TCBs that are using a DB2 connection at the time of the inquiry, and this value varies depending on workload.
THREADERROR(cvda)
Returns the processing that is to occur following a create thread error. CVDA values are as follows:
ABEND
For a second or subsequent SQL error, the transaction is abended with abend code AD2S, AD2T, or AD2U, depending on the type of error that occurred. The transaction must be stopped and reinitialized before it is allowed to issue another SQL request.
N906D
A transaction dump is to be taken and the DSNCSQL RMI associated with the transaction is not to be disabled. The transaction receives a -906 SQLCODE if another SQL is issued, unless the transaction issues SYNCPOINT ROLLBACK command. SYNCPOINT without the ROLLBACK option results in an ASP3 or ASP7 abend. The transaction dump records an abend of AD2S, AD2T, or AD2U.
N906
The DSNCSQL RMI associated with the transaction is not to be disabled. The transaction receives a -906 SQLCODE if another SQL request is issued, unless the transaction issues a SYNCPOINT ROLLBACK command. SYNCPOINT without the ROLLBACK option results in an ASP3 or ASP7 abend.
THREADLIMIT(data-area)
Returns the current maximum number of pool threads that the CICS DB2 attachment allows active before requests are made to wait or are rejected. See THREADWAIT.
THREADS(data-area)
Returns the current number of active pool threads.
THREADWAIT(cvda)
Returns a value showing whether transactions wait for a pool thread or are stopped if the number of active pool threads reaches the THREADLIMIT number. CVDA values are as follows:
TWAIT
If all threads are busy, a transaction waits until one becomes available.
NOTWAIT
If all threads are busy, a transaction is stopped with an abend code AD3T.

Conditions

NOTFND
RESP2 values:
1
The DB2CONN cannot be found.
NOTAUTH
RESP2 values:
100
Command authorization failure