Using a C program

To verify Fault Analyzer with DB2® using a C program, edit and submit the sample job IDIVPDB2 in data set IDI.SIDISAM1. Refer to the instructions in the sample job for more information.

The job executes an already compiled and linked ODBC C program, which has been provided as load module IDIVPDB2 in data set IDI.SIDIAUTH. The program deliberately abends with a system abend code of S0C4.

Note:
This IVP is based on the DB2® ODBC IVP that is usually shipped by DB2® in the DSN.SDSNSAMP data set as members DSNTEJ8 (JCL) and DSN8OIVP (C source code). This IVP has been modified to deliberately abend while in the connection with DB2® so that Fault Analyzer is invoked and includes a report section for DB2® information. The Fault Analyzer version of the source code is provided for your reference at the end of the IDIVPDB2 sample member.

As a result of the TER(UATRACE) LE option, Fault Analyzer is invoked via the MVS change options/suppress dump exit, IDIXDCAP.

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.


A system abend 0C4 reason code X'4' occurred in module IDIVPDB2 program IDIVCDB2
entry point main at offset X'590'. 

A program-interruption code 0004 (Protection Exception) is associated with this
abend and indicates that:

    An attempt to store into the range 0-511 or 4096-4607 with low-address
    protection enabled.   

The abend was caused by machine instruction 50000000 (STORE).

NOTE: Source code information could not be presented because the source line for
      program IDIVCDB2 is not available (it could be in an include file and     
      NOSHOWINC is in effect). The source line # from the GONUMBER option is 126
      for offset X'DA8'. 

A complete sample report from running this IVP is provided as member IDISRP04 in the IDI.SIDIDOC1 data set.

The data written to SYSPRINT should contain:
IDIVPDB2 INITIALIZATION
IDIVPDB2 SQLAllocEnv
IDIVPDB2-henv=1
IDIVPDB2 SQLAllocConnect
IDIVPDB2-hdbc=1
IDIVPDB2 SQLConnect
IDIVPDB2 successfully issued a SQLconnect
IDIVPDB2 SQLAllocStmt
IDIVPDB2 hstmt=1
IDIVPDB2 successfully issued a SQLAllocStmt
IDIVPDB2 SQLExecDirect
IDIVPDB2 sqlstmt=SELECT * FROM SYSIBM.SYSDUMMY1
IDIVPDB2 successfully issued a SQLExecDirect
IDIVPDB2 SQLFetch
IDIVPDB2 successfully issued a SQLFetch
IDIVPDB2 SQLTransact
IDIVPDB2 successfully issued a SQLTransact
IDIVPDB2 Abend S0C4 to invoke Fault Analyzer...