CSUB trace

The CSUB is the connection control block that CICS uses to manage, and exchange information about, a thread into DB2. It is the CICS equivalent to the DB2 connection control block. The CSUB is linked to the thread TCB that CICS uses to run the thread.

See Overview: How CICS connects to DB2 for a full explanation of the relationship between the CSUB, the DB2 connection control block and the thread TCB.

When CICS is connected to DB2, and is using the open transaction environment, the thread TCB is an open TCB known to the CICS dispatcher and kernel. The CICS DB2 thread processor DFHD2D2, which replaces DFHD2EX3 in the open transaction environment, can therefore use CICS tracing. As well as using CICS tracing, DFHD2D2, like DFHD2EX3, maintains a trace table at the end of the CSUB control block to record the requests it makes to DB2, and the responses to those requests.

The CSUB trace table is 160 bytes in length allowing ten entries of 16 bytes to be written. The trace table wraps when all ten entries have been used. The format of each trace entry is shown in Table 1.

Table 1. Layout of CSUB trace table entry
Bytes Content Information
Bytes 0-3 Trace request number Fullword number of the trace entry written. The number is used to find the latest entry written.
Bytes 4-7 Trace request Four-character representation of the DB2 request issued. Possible values are:

ABRT - Abort request
API - SQL or IFI request
ASSO - Associate request
COMM - Commit request
CTHD - Create thread request
DISS - Dissociate request
ERRH - Error handler request
IDEN - Identify request
PREP - Prepare request
PSGN - Partial signon request
SIGN - Full signon request
SYNC - Single phase request
TERM - Terminate thread request
TIDN - Terminate identify request
TSGN - Terminate signon request
*REC - Recovery routine entered

Bytes 8-9 reserved  
Bytes 10-11 frb return code Two-byte frb return code
Bytes 12-15 frb reason code Four-byte frb reason code

The CSUB control block is formatted in a CICS system dump. It is also output if RI (RMI) level 2 trace is active in traces output from the CICS task-related user exit DFHD2EX1, plus all exception traces from DFHD2EX1.

Figure 1 shows the same situation when CICS is connected to DB2 Version 6 or later. In this example you can see that an identify, signon, and create thread have been issued to DB2. There is an API request, followed by a syncpoint and a dissociate (which dissociates the DB2 connection control block from the L8 TCB). The transaction now makes another API request, starting another unit of work, and the DB2 connection control block is reassociated (ASSO) with the L8 TCB. A partial signon occurs to create an accounting record for the previous unit of work. The API request is now issued to DB2.
Figure 1. Sample CSUB trace — CICS connected to DB2
6-0000  03206EC4 C6C8C4F2 C3E2C240 40404040  CFE6D380 716D6B32 2B0A1300 2B0D36C0  *..>DFHD2CSB     .WL.._,........{*
  0020  2C6A8370 0098DC88 00000000 00000000  CFE6D381 5F3C62FE 00000000 00000000  *..c..q.h.........WLa¬...........*
  0040  2B0D372C 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0060  00000000 00000000 00000000 E3C5E2E3  D7F0F540 C3C9C3E2 E4E2C5D9 40404040  *............TESTP05 CICSUSER    *
  0080  40404040 C5D5E3D9 E7D7F0F5 F0F0F0F1  00000000 CFE6D380 742927E2 C7C2C9C2  *    ENTRXP050001.....WL....SGBIB*
  00A0  D4C9E8C1 C9E8C3E6 E3F1F5F0 E6D37E22  16AC8000 44A00000 00000001 C3C9C3E2  *MIYAIYCWT150WL=.............CICS*
  00C0  E4E2C5D9 40404040 40404040 40404040  40404040 40404040 40404040 FF4EA000  *USER                        .+..*
  00E0  C6D9C240 00030001 2AF0DCB0 00000000  00000000 00000000 00180A05 00010000  *FRB .....0......................*
  0100  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0120  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0140  00000000 00000000 00000000 00000000  00000000 00000000 ACB8C110 00000000  *..........................A.....*
  0160  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0180  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  01A0  00000000 00000000 00000000 00000000  40404040 40404040 40404040 40404040  *................                *
  01C0  40404040 40404040 40404040 40404040  40404040 40404040 40404040 40404040  *                                *
  01E0  40404040 00000001 00000048 42600048  2C6511B8 00000000 00000000 00000000  *    .........-..................*
  0200  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0220  00000000 00000000 00000000 00000000  00000000 00000000 00000000 00000000  *................................*
  0240  00000000 00000000 00000000 00000000  00000000 00000000 0000000C 2CB8C2B0  *..............................B.*                 
  0260  6E6EE399 81838540 E2A38199 A3406E6E  0100067C C9C4C5D5 00000000 00000000  *>>Trace Start >>....IDEN........*
  0280  0200067C E2C9C7D5 00000000 00000000  0300067C C3E3C8C4 00000000 00000000  *....SIGN............CTHD........*
  02A0  0400067C C1D7C940 00000000 00000000  0500067C E2E8D5C3 00000000 00000000  *....API ............SYNC........*
  02C0  0600067C C4C9E2E2 00000000 00000000  0700067C C1E2E2D6 00000000 00000000  *....DISS............ASSO........*
  02E0  0800067C D7E2C7D5 00000000 00000000  0900067C C1D7C940 00000000 00000000  *....PSGN............API ........*
  0300  00000000 00000000 00000000 00000000  4C4CE399 81838540 C5958440 40404C4C  *................<


dfhtk5f.html | Timestamp icon Last updated: Monday, 5 June 2017