Activating the DSN trace stream

The DSN trace stream consists of trace messages; each represents a specific function that has been or is about to be performed. View these messages on the screen or specify that they be collected in a data set, or both. These messages are especially valuable in diagnosing possible WAITs and LOOPs.

About this task

The DSN trace stream can be activated through explicit DSN commands or through DB2I.

Procedure

To activate the DSN trace stream, choose one of the following approaches:

  • Activate the DSN trace stream using explicit DSN commands.
    1. Start the DSN session with the TEST parameter, on the DSN command, set to a number that is greater than 100. Entering a number greater than 100 results in the tracing of all the CSECTs.
      Use the following command:
      DSN SYSTEM(subsystem_name) TEST(255)
      where subsystem_name is the site-defined name of the subsystem.

      A DSN session begins when DSN is entered from the TSO environment. To turn on the DSN trace stream during a DSN session, re-enter the DSN subcommand shown above within the current DSN session.

    2. When the DSN trace is activated, all trace messages are routed through the TSO message issuer routine (IKJEFF02) to the TSO SYSTSPRT DD statement. Optionally, the DSN trace information can be duplicated by allocating a separate data set with a DD name of DSNTRACE. The DSNTRACE data set can then be used to maintain a separate log for offline reference and diagnosis that contains only the trace messages produced by the DSN command. The DSNTRACE data set should be allocated prior to DSN invocation as a sequential data set, with RECFM=F, and LRECL=132.
    3. Review the DSN trace messages that appear on the terminal or in the data set that has collected the trace stream.

      The text contained in these DSN trace messages often provides clues about the problem. For diagnosing problems, special messages clearly show control passing from DSN to Db2 and back. They can help to determine whether a problem is in Db2, DSN, or an application program.

      Specifically, the trace messages that contain a line of equal signs indicate when control is being passed between the application and Db2. The series of equal signs can be thought of as a wall between DSN and Db2 that indicates in which area a given trace event occurs. Each of these trace messages begins with one of the following lines:
      BEFORE some event =============
      AFTER  that event =============

      Whenever a BEFORE message is displayed, this indicates that control has been passed to Db2. Whenever an AFTER message is displayed, this indicates that control has returned to the application program.

    4. Refer to the notes about the DSN trace stream for additional information.
  • Activate the DSN trace stream using DB2I.
    1. Invoke the DB2I primary menu (DSNEPRI).
    2. Select OPTION 0, which is not shown on the menu.
    3. Press ENTER to pass the panel that introduces the Db2 TSO MAINTENANCE SYSTEM.
      The next panel provides choices between several TSO attachment facility tracing mechanisms.
    4. Enter a value greater than 100 in the TRACE DSN field. Press ENTER to return to the DB2I primary menu.
    5. Run the application, and the DSN trace messages display.

Example

Figure 1. Sample TSO attachment facility DSN trace messages. Each pair of BEFORE SQL CALL and AFTER SQL CALL trace messages represents the processing of one SQL statement.
DSNET20I  DSNECP13  CIBCORID :H443722 X'00000000' X'00000000'
DSNET20I  DSNECP13  ZINDOUBT :NO X'00000000' X'00000000'
DSNET20I  DSNECP13  BEFORE CREATE THREAD DB2 CALL======R6,CIBRFRB X'00187840' X'00187DA0'
DSNET20I  DSNECP13  AFTER CREATE THREAD DB2 CALL======R6,CIBRFRB X'00187840' X'00187DA0'
DSNET20I  DSNECP13  FOLLOWING ARE FRB FIELD CONTENTS, CIBCTFRM= X'00187DA0' X'00000000'
DSNET20I  DSNECP13  FRBRAL(PTR), FRBRALE(BIN15), FRBFVLE(BIN15) X'00000000' X'00010004'
DSNET20I  DSNECP13  FRBPARM(PTR), FRBPCNT(BIN15) X'00000000' X'00000000'
DSNET20I  DSNECP13  FRBRC1(BIN15), FRBRC2(CHAR4) X'00000000' X'00000000'
DSNET20I  DSNECP13  FRBFBACK PRT(31), FRBRHPC X'00000000' X'00000000'
DSNET20I  DSNECP13  FRBQUAL(BIN15), FRBRSV1(BIN15) X'00000001' X'00000000'
DSNET20I  DSNECP13  CIBPLNID :TSOAP1 X'00000000' X'00000000'
DSNET20I  DSNECP13  ZINDOUBT :NO X'00000000' X'00000000'
DSNET20I  DSNECP13  R6=, CIBCTRTN=X'00187840' X'E2E8D5C3'
DSNET20I  DSNECP13  EXIT DSNECP13 X'00000000' X'00187DA0'
DSNET20I  DSNECP28  AFTER DSNECP13, CIBCTRTN=,CIBCTFRB= X'E2E8D5C3' X'00187DA0'
DSNET20I  DSNECP28  HERE COMES THE FRB <<<<<<<<<<<<<<< CIBRFRB= X'80187DA0' X'00000000'
DSNET20I  DSNECP28  FRBRAL(PTR),    FRBRALE(BIN15), FRBFVLE(BIN15) X'00000000' X'00030001'
DSNET20I  DSNECP28  FRBPARM(PTR),   FRBPCNT(BIN15) X'001AB1E0' X'000000000'
DSNET20I  DSNECP28  FRBRC1(BIN15),  FRBRC2(CHAR4) X'00000000' X'00000000'
DSNET20I  DSNECP28  FRBFBACK:                                               X'00000000' X'00000000'
DSNET20I  DSNECP28  FRBFBACK PTR(31),FRBRHPC X'00000000' X'00000000'     840' X'00187DA0'
DSNET20I  DSNECP28  FRBQUAL(BIN15), FRBRSV1(BIN15) X'00000001' X'00000000'
DSNET20I  DSNECP28  EXIT DSNECP28,CIBRFRB,CIBFRMLI X'80187DA0' X'00000000'
DSNET20I  DSNETRAP  BEFORE SQL CALL=======================FRB,R1== X'80187DA0' X'00187870'
DSNET20I  DSNETRAP  AFTER SQL CALL=====================RC1,FBACK== X'00000000' X'00000000'
DSNET20I  DSNETRAP  BEFORE SQL CALL=======================FRB,R1== X'80187DA0' X'00187870'
DSNET20I  DSNETRAP  AFTER SQL CALL=====================RC1,FBACK== X'00000000' X'00000000'
DSNET20I  DSNETRAP  AFTER LINK GOOD, R15=, R1= X'00000000' X'0018753C'   40' X'00187DA0'
DSNET20I  DSNECP18  ENTER DSNECP18, CIBTRMOP= X'E2E8D5C3' X'00000000'
DSNET20I  DSNECP18  CIBTRMOP NOT BLANK, CIBTRMOP= X'E2E8D5C3' X'00000000'
DSNET20I  DSNECP18  FRB FIELDS FOLLOW (CIBFRB): X'00187DA0' X'00000000'
DSNET20I  DSNECP18  FRBRAL(PTR),    FRBRALE(BIN15), FRBFVLE(BIN15) X'00000000' X'00010001'
DSNET20I  DSNECP18  FRBPARM(PTR),   FRBPCNT(BIN15) X'001873A8' X'00000000'
DSNET20I  DSNECP18  FRBRC1(BIN15),  FRBRC2(CHAR4) X'00000000' X'00000000'
DSNET20I  DSNECP18  FRBFBACK(PTR),  FRBRHPC(BIN32) X'00000000' X'00000000'
DSNET20I  DSNECP18  FRBQUAL(BIN15), FRBRSV1(BIN15) X'00000001' X'00000000'
DSNET20I  DSNECP18  BEFORE TERMINATE DB2 CALL===============TRMOP= X'E2E8D5C3' X'00000000'
DSNET20I  DSNECP18  AFTER TERMINATE DB2 CALL====================== X'00000000' X'00000000'
DSNET20I  DSNECP18  FRB FIELDS FOLLOW (CIBFRB): X'00187DA0' X'00000000'
DSNET20I  DSNECP18  FRBRAL(PTR),    FRBRALE(BIN15), FRBRVLE(BIN15) X'00000000' X'00010001'