Using a COBOL program

To verify Fault Analyzer with DB2® using a COBOL program, edit and submit the sample job IDIVPDBB in data set IDI.SIDISAM1. This job uses as input another sample member, IDISDB2B, containing the COBOL program source code. Refer to the instructions in the sample job for more information.

The job compiles and executes a COBOL program, which abends with a system abend code of S0C9.

Note: This IVP is based on the DB2® COBOL IVP that is usually shipped by DB2® in the DSN.SDSNSAMP data set as members DSNTEJ2C (JCL) and DSN8BC3 (COBOL source code). This IVP has been modified to deliberately abend after having performed DB2® data base access, so that Fault Analyzer is invoked and includes a report section for DB2® information.

Before running this IVP, ensure that the DB2® sample data base environment is set up correctly. Follow the instructions in the DB2® for z/OS® Installation and Migration Guide for running the DSNTEJ2C DB2® IVP. Once DSNTEJ2C is running correctly, then either make the changes listed in the Fault Analyzer IDIVPDBB sample to the DB2® DSNTEJ2C sample, or make the same changes that were made to the DB2® DSNTEJ2C sample in the Fault Analyzer IDIVPDBB sample.

As a result of the TER(TRACE) LE option that is specified on the DB2® RUN command for the IDISDB2B program, Fault Analyzer is invoked via the LE CEEEXTAN exit, IDIXCEE.

The synopsis section of the Fault Analyzer report that is written to IDIREPRT should contain the following:

For the Japanese feature of Fault Analyzer, this section should be in Japanese if the Language(JPN) option is in effect.

Note: Due to differences in version, release or maintenance level of the compiler used, program offset information might differ from the sample below.
A system abend 0C9 occurred in module IDISDB2B program IDISDB2B at offset
X'1EE2'.

A program-interruption code 0009 (Fixed-Point-Divide Exception) is associated
with this abend and indicates that:

  The divisor was zero in a signed binary division.

The cause of the failure was program IDISDB2B in module IDISDB2B.  The COBOL
source code that immediately preceded the failure was:

  Source
  Line #
  ------
  001165                 DIVIDE NOT-FOUND BY PERCENT-COUNTER
  001166                    GIVING ERROR-TEXT-LEN.

The COBOL source code for data fields involved in the failure:

  Source
  Line #
  ------
  000137        77  NOT-FOUND           PIC S9(9) COMP VALUE  +100.
  000146        77  ERROR-TEXT-LEN      PIC S9(9)  COMP VALUE +120.
  000207       *
  000208        77  PERCENT-COUNTER             PIC S9(4)  COMP.

Data field values at time of abend:

  ERROR-TEXT-LEN  = 120
  NOT-FOUND       = 1
  PERCENT-COUNTER = 0  *** Cause of error ***
The analysis should include a DB2® Information section similar to the following:
Note: Installation-specific names and values are likely to differ from those shown in the sample below.
--------------------------------------------------------------------------------
<H3> DB2 Subsystem DB42

DB2 Version . . . . . . . . : V8R1M5
Plan Name . . . . . . . . . : DSN8BH81 (Bound 2006/08/25 14:30:52)
Plan Owner. . . . . . . . . : NWILKES
Database Request Module Name: DB2V810.DB42.DBRMLIB.DATA(IDISDB2B)
Consistency Token . . . . . : X'17E9C40018AE6A18'
Primary Authorization ID. . : NWILKES
Current SQL ID. . . . . . . : NWILKES

                              Source
                              Line #
                              ------
Last Executed SQL Statement : 001149       *****     EXEC SQL FETCH TELE1 INTO :PPHONE END-EXEC.

Fault Analyzer Event #. . . : 4 (Program IDISDB2B)
Declare Cursor Stmt No. . . : 200
Declare Cursor Stmt . . . . : DECLARE TELE1 CURSOR FOR SELECT * FROM DSN8810 .
                              VPHONE
Open Cursor Stmt No . . . . : 346
Open Cursor Stmt. . . . . . : OPEN TELE1

Output Host Variables:
  Name and Data Type. . . . : PPHONE.LASTNAME VARCHAR(15)
    At Address. . . . . . . : 168A83D8
    Data Value. . . . . . . : HAAS

  Name and Data Type. . . . : PPHONE.FIRSTNAME VARCHAR(12)
    At Address. . . . . . . : 168A83E9
    Data Value. . . . . . . : CHRISTINE

  Name and Data Type. . . . : PPHONE.MIDDLEINITIAL CHARACTER(1)
    At Address. . . . . . . : 168A83F7
    Data Value. . . . . . . : I

  Name and Data Type. . . . : PPHONE.PHONENUMBER CHARACTER(4)
    At Address. . . . . . . : 168A83F8
    Data Value. . . . . . . : 3978

  Name and Data Type. . . . : PPHONE.EMPLOYEENUMBER CHARACTER(6)
    At Address. . . . . . . : 168A83FC
    Data Value. . . . . . . : 000010

  Name and Data Type. . . . : PPHONE.DEPTNUMBER CHARACTER(3)
    At Address. . . . . . . : 168A8402
    Data Value. . . . . . . : A00

  Name and Data Type. . . . : PPHONE.DEPTNAME VARCHAR(36)
    At Address. . . . . . . : 168A8405
    Data Value. . . . . . . : SPIFFY COMPUTER SERVICE DIV.

--------------------------------------------------------------------------------
<H3> DB2 Control Blocks

SQL Communications Area (SQLCA) for subsystem DB42 not shown as it is identical
to the SQLCA in the detail section for event # 4 program IDISDB2B.