You can query and purge tasks that use DBCTL
using the CICS® CEMT
transaction as for any CICS task.
About this task
However, if a transaction has hung in
DBCTL, and you need to purge it, you must use the DBCTL command /STOP THREAD.
To
find out what is happening to a task:
Issue CEMT INQ TASK to find out what tasks are active.
Expand the information on individual tasks by typing a ? to the left of
the task you want to see. You will get a display like the one in Figure 1.
Figure 1. CEMT INQ TASK (expanded)
I TA
SYNTAX OF SET COMMAND
Tas(0000110) Tra(DLID) Fac(D2D3) Sus Ter Iso Pri( 001 )
Hty(DBCTL ) Hva(DLSUSPND) Hti(000007) Sta(TO)
Use(CICSUSER) Rec(X'9EDA1F61E11CFA02')
CEMT Set TAsk() | < All >
< PRiority() >
< PUrge | FOrcepurge >
SYSID=CIC1 APPLID=DBDCCICS
PF 1 HELP 3 END 7 SBH 8 SFH 9 MSG 10 SB 11 SF
Figure 1 includes the following useful
information:
Tas(0000110): task identifier
Tra(DLID): transaction name of the task
Fac(D2D3): identifier of the terminal or queue that initiated
the task
Sus: the task is suspended
Ter: the task was initiated from a terminal
Pri(001): the task is running with a priority of 1
Hty(DBCTL): the task is currently issuing a DL/I request
to DBCTL
Hva(DLSUSPND): the task is suspended in DBCTL
Hti(000007): how long, in seconds, the task has been
sus pended
Sta(TO): how the task was started; TO means from a terminal
by an operator entering a transaction
Use(CICSUSER): is the userid of the user who initiated
the task
Rec(X'9EDA1F61E11CFA02') shows the recovery token associated
with the task
The screen also contains a reminder of the syntax of the CEMT SET TASK
command, which you may need to use; for example, if you want to purge the
suspended task.
SYSID=CIC1: CICS system identifier, as specified in
the system initialization parameter SYSIDNT.
APPLID=DBDCCICS: APPLID for the CICS system.
Issue CEMT INQ TASK again.
If the response indicates that the task is no longer suspended in DBCTL,
you can purge it using CEMT SET TASK(n) PURGE as for any CICS task. The
purge takes place after the DL/I request to DBCTL has completed.
If the response indicates that the task is still suspended in DBCTL, the
task has hung in DBCTL, and you must use DBCTL operator commands to
purge it.
To do this:
From the CEMT INQ TASK display, make a note of the CICS APPLID and the 16-digit recovery token.
(You can use a recovery token to find the thread number of a CICS task in
DBCTL. For a fuller definition, see CICS DBCTL recovery tokens.)
At the DBCTL console, enter /DISPLAY CCTL cctlname, where cctlname is
the CICS APPLID
(in this example, it is DBDCCICS). This causes the current status of DL/I
activity to be displayed, as shown in Figure 2.
Figure 2. Output from /DISPLAY CCTL cctlname
0080 /DIS CCTL DBDCCICS
0080 DFS000I MESSAGE(S) FROM ID=SYS1 047
0080 CCTL PSEUDO-RTKN RECOVERY-TOKEN REGID PSBNAME STATUS
0080 DBDCCICS ATTACHED
0080 9EDA1F61E11CFA02 6 PC3COCHD ACTIVE
0080 9EDA1F4E9B571B02 5 PC3COCHD ACTIVE
0080 *88204/101241*
Find the recovery token (9EDA1F61E11CFA02 in this example) that matches
the one you noted from the CEMT INQ TASK display, and then note the thread
number that is next to it in the REGID column (6 in this example).
Issue the command:
/STOP THREAD n ABDUMP
where
n is the thread number.
This causes the thread and transaction to terminate
when it has finished processing the current request, and causes a dump to
be taken.
If the thread does not stop, use:
/STOP THREAD n CANCEL
Do
not use /STOP THREAD CANCEL if you do not need to, because it may cause DBCTL
to terminate with a U113 abend.