Wait types for CICS DB2
The CICS® DB2® task-related user exit, DFHD2EX1, issues WAIT_MVS calls for different purposes, these calls are distinguished by their resource name and type values. The resource name and resource type values are visible in the dispatcher section of a CICS system dump and also appear on the CEMT INQUIRE TASK panel as Hty and Hva values respectively.
The CICS DB2 task-related user exit and the request into DB2 run on an L8 open TCB. The CICS task is not put into a CICS dispatcher wait when active in DB2, so there is no related information in the dispatcher section of the CICS system dump. The CEMT INQUIRE TASK panel shows that the CICS DB2 task is running on an open TCB. To find out if the task is active in DB2, use the DSNC DISPLAY TRAN command (see DSNC DISPLAY). This command displays all the threads currently in use, and the task with which each thread is associated. See DISPLAY PLAN or TRAN for an example of the output from the command. If the thread associated with the task has a status of '*' in the 'S' field, this shows that the thread is currently active in DB2. The task is therefore either running or waiting in DB2.
The full list of waits issued from the CICS DB2 task-related user exit DFHD2EX1, their meanings, and whether the task can be purged or forcepurged out of this wait is given in Table 1. A fuller explanation of each wait follows the table.
| Resource type or Hty value | Resource name or Hva value | Meaning | Purge and forcepurge |
|---|---|---|---|
| DB2 | LOT_ECB | CICS task is waiting for DB2, that is, waiting for the CICS DB2 task to complete the request. Used when CICS is connected to DB2 Version 5 or earlier. | Purge: No. Forcepurge: Yes |
| CDB2RDYQ | name of DB2ENTRY or *POOL | CICS task is waiting for a thread to become available. The resource name details for which DB2ENTRY or the pool has a shortage of threads. | No |
| CDB2CONN | The CICS task has an open TCB but is waiting for a DB2 connection to become available to use with the open TCB. This indicates that TCBLIMIT has been reached, and the maximum permitted number of open TCBs (and hence connections) are being used to access DB2. | No |
CDB2RDYQ indicates that the THREADLIMIT value of a DB2ENTRY or the pool has been exceeded, and that THREADWAIT is set to YES, indicating that the task should wait. Purge of the task in this state is not allowed. If you attempt to forcepurge the task, message DFHAP0604 is issued to the console, and forcepurge is deferred until a thread has been acquired and the task is no longer queued waiting for a thread. Instead of purging the task, you can use a SET DB2ENTRY() THREADLIMIT(n) command to increase the number of threads available for the DB2ENTRY, or a SET DB2CONN THREADLIMIT(n) if it is the pool. CICS posts tasks to try again to acquire a thread if the threadlimit is increased.
CDB2CONN indicates that the CICS task has obtained an open TCB from the pool of L8 and L9 mode open TCBs, but is waiting for a DB2 connection to become available to use with the open TCB. This shows that the TCBLIMIT specified in the DB2CONN has been reached, which limits the number of open TCBs (and hence connections) that can be used to access DB2. When the TCBLIMIT is reached, the CICS DB2 task-related user exit can obtain a TCB from the pool of L8 and L9 mode open TCBs, but it must wait before it can use the TCB to run a thread into DB2. When another task stops using its L8 or L9 mode TCB to run a thread into DB2, and so the number of TCBs in use running threads falls below TCBLIMIT, the waiting task is allowed to use its own L8 or L9 mode TCB to run a thread into DB2.
Purge of the task is not allowed for a CDB2CONN wait. If you attempt to forcepurge the task, message DFHAP0604 is issued to the console, and forcepurge is deferred until a DB2 connection has been acquired. Instead of purging the task, you can use a SET DB2CONN TCBLIMIT command to increase TCBLIMIT, which increases the number of open TCBs permitted to access DB2. If you increase TCBLIMIT, CICS posts tasks to try again to acquire a DB2 connection.
If the limit set automatically by CICS for the number of L8 and L9 mode open TCBs is reached, so no more open TCBs can be created, the task is suspended with HTYPE(DISPATCH) and HVALUE(OPEN_TCB). CICS sets this limit using the formula (2 * MXT value) + 32, with the MXT or MAXTASKS value for the CICS region. The task is suspended with HTYPE(CDB2CONN) in the situation where this limit is not exceeded, but TCBLIMIT is exceeded.
Table 2 gives details of WAITS issued using WAIT_OLDC dispatcher calls where the ECB is hand posted:
| Resource type or Hty value | Resource name or Hva value | Meaning | Purge and forcepurge |
|---|---|---|---|
| DB2_INIT | CICS DB2 initialization program DFHD2IN1 issues the wait to wait for the CICS initialization task running program DFHD2IN2 to complete. | Yes | |
| DB2CDISC | name of DB2CONN | A SET DB2CONN NOTCONNECTED command has been issued with the WAIT or FORCE option. DFHD2TM waits for the count of tasks using DB2 to reach zero. | Yes |
| DB2EDISA | name of DB2ENTRY | A SET DB2ENTRY DISABLED command has been issued with the WAIT or FORCE option. DFHD2TM waits for the count of tasks using the DB2ENTRY to reach zero. | Yes |
Table 3 shows details of EXEC CICS WAIT EXTERNAL requests issued by the CICS DB2 attachment facility.
| Resource type or Hty value | Resource name or Hva value | Meaning | Purge and forcepurge |
|---|---|---|---|
| USERWAIT | CDB2TIME | The CICS DB2 service task program DFHD2EX2 is in its timer wait cycle either waiting for the protected thread purge cycle to pop or to be posted for another event. | Yes |
| USERWAIT | DB2START | The CICS DB2 service program DFHD2EX2 is waiting for DB2 to post it when it becomes active. | Yes |
Table 4 gives details of EXEC CICS WAIT EVENT requests issued by the CICS DB2 attachment facility:
| Module | Resource name | Meaning |
|---|---|---|
| DFHD2EX2 | PROTTERM | A TERM call has been issued for a protected thread during the protected thread purge cycle. |
| DFHD2STR | ATCHMSUB | The CICS DB2 startup program DFHD2STR has attached the master subtask program DFHD2MSB and is waiting for it to identify to DB2. (Only applies when CICS is connected to DB2 Version 5 or earlier.) |
| DFHD2STR | DTCHMSUB | The CICS DB2 startup program is waiting for the master subtask program DFHD2MSB to terminate. (Only applies when CICS is connected to DB2 Version 5 or earlier.) |
| DFHD2STP | MSBRETRN | The CICS DB2 shutdown program is waiting for the master subtask program DFHD2MSB to terminate. (Only applies when CICS is connected to DB2 Version 5 or earlier.) |
| DFHD2STP | CEX2TERM | The CICS DB2 shutdown program is waiting for the CICS DB2 service task CEX2 running program DFHD2EX2 to terminate all subtasks and terminate itself. |