The CICS® DB2® task-related user exit, DFHD2EX1, issues WAIT_MVS™ calls for different purposes, and these are distinguished by different resource name and resource 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.
When CICS is connected to DB2 Version 5 or earlier, DFHD2EX1 runs on the CICS main TCB (the QR TCB). It uses the WAIT_MVS function of CICS dispatcher domain to put the running CICS task into a CICS dispatcher wait while the DB2 request is run on a subtask TCB. This wait is represented by a resource type of "DB2".
When CICS is connected to DB2 Version 6 or later, 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.
As an example, take a situation that can occur when CICS is connected to DB2 Version 5 or earlier. When a CICS system dump is taken, a CICS task is waiting for the CICS DB2 task to complete its work in DB2. This wait is represented by a resource type of "DB2" and a resource name of "LOT_ECB". The examples shown in Figure 43, Figure 44, and Figure 45 show how this would appear in the dispatcher section of CICS system dump, and using the CEMT inquire task panels.
DS_TOKEN KE_TASK TY S P PS TT RESOURCE RESOURCE ST TIME OF
TYPE NAME SUSPEND
00020003 029D7C80 SY SUS N OK - TIEXPIRY DS_NUDGE SUSP 18:50:29
000C0005 029CAC80 SY SUS N OK - SUSP 18:11:22
000E0005 02B99080 SY SUS N OK - JCJOURDS DFHJ01A SUSP 18:39:39
00120007 02B99780 SY SUS N OK - KCCOMPAT SINGLE OLDW 17:02:12
00160005 02B99B00 SY SUS N OK - JCTERMN SUBTASK OLDW 17:01:56
00180003 029CA580 SY SUS N OK - ICMIDNTE DFHAPTIM SUSP 08:00:00
001A0003 029CA200 SY SUS N OK - TCP_NORM DFHZDSP OLDW 18:51:27
001C0003 03F03900 SY SUS N OK - ICEXPIRY DFHAPTIX SUSP 18:50:29
008A0005 02B92080 SY SUS N OK - JCJOURDS DFHJ02A SUSP 17:02:04
008E0001 02B13080 SY SUS N OK IN SMSYSTEM SUSP 18:47:49
0102006F 02BA9080 NS SUS Y OK - DB2 LOT_ECB MVS 18:51:22
01040031 02BA9780 NS RUN
01060009 02B13B00 NS SUS Y OK - MVS 18:50:29
INQUIRE TASK STATUS: RESULTS - OVERTYPE TO MODIFY Tas(0000151) Tra(DSNC) Sus Tas Pri( 255 ) ? Tas(0000161) Tra(XC05) Fac(1303) Sus Ter Pri( 001 ) Tas(0000162) Tra(CEMT) Fac(1302) Run Ter Pri( 255 )
INQUIRE TASK SYNTAX OF SET COMMAND Tas(0000161) Tra(XC05) Fac(1303) Sus Ter Pri( 001 ) Hty(DB2 ) Hva(LOT_ECB ) Hti(000018) Sta(TO) Use(SYSADM ) Rec(X'A8B5FE112D54CA85') CEMT Set TAsk() | < All > < PRiority() > < PUrge | FOrcepurge >
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 12. 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 (but see below). |
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 |
CDB2TCB | Used instead of CDB2CONN when CICS is connected to DB2 Version 5 or earlier. The CICS task is waiting for a CICS DB2 subtask to become available. This indicates that TCBLIMIT has been reached, and all subtask TCBs are in use running threads. | No | |
CDB2CONN | Used instead of CDB2TCB when CICS is connected to DB2 Version 6 or later. 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 |
A resource type of DB2 is only used when CICS is connected to DB2 Version 5 or earlier. It indicates that the task is waiting for DB2 or, more specifically, the task is waiting for its associated CICS DB2 task to complete the DB2 request and post it back. The task can be forcepurged when in this state, in which case the CICS task abends and backout occurs. In addition, the CICS DB2 task is detached, causing DB2 to back out as well. Forcepurging a task in this state can cause termination of the DB2 subsystem, if the CICS DB2 task is terminated during a "must complete" activity in DB2. To avoid this risk, use the DB2 CANCEL THREAD command before issuing the forcepurge--see Purging CICS DB2 transactions for the procedure.
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.
CDB2TCB is used instead of CDB2CONN when CICS is connected to DB2 Version 5 or earlier. It indicates that the task is allowed a thread, but all the existing CICS DB2 subtask TCBs are in use, and the TCBLIMIT specified in the DB2CONN has been reached, so no new TCBs can be attached. Purge of the task is not allowed. If you attempt to forcepurge the task, message DFHAP0604 is issued to the console, and forcepurge is deferred until a TCB has been acquired and the task is no longer queued waiting for a TCB. Instead of purging the task, you can use a SET DB2CONN TCBLIMIT command to increase TCBLIMIT, which increases the number of subtask TCBs allowed. If you increase TCBLIMIT, CICS posts tasks to try again to acquire a CICS DB2 subtask.
CDB2CONN is used instead of CDB2TCB when CICS is connected to DB2 Version 6 or later. It indicates that the CICS task has obtained an open TCB from the pool of 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. (See The MAXOPENTCBS system initialization parameter and TCBLIMIT for an explanation of the role of TCBLIMIT in the open transaction environment.) The CICS task must wait for a connection to be freed by another TCB running on behalf of another CICS task, after which it may use the freed DB2 connection with its own TCB. Purge of the task is not allowed. 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.
Table 13 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 14 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 15 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. |