Using a C program

To verify Z Abend Investigator with DB2® using a C program, edit and submit the sample job HFZVPDB2 in data set HFZ.SHFZSAM1. 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 HFZVPDB2 in data set HFZ.SHFZAUTH. 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 Z Abend Investigator is invoked and includes a report section for DB2® information. The Z Abend Investigator version of the source code is provided for your reference at the end of the HFZVPDB2 sample member.

As a result of the TER(UATRACE) LE option, Z Abend Investigator is invoked via the MVS change options/suppress dump exit, HFZXDCAP.

The synopsis section of the Z Abend Investigator report that is written to HFZREPRT should contain the following:

For the Japanese feature of Z Abend Investigator, 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 HFZVPDB2 program HFZVCDB2
at offset X'C74'.

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

  A protection exception occurred due to one of the following:

  - An attempt to access a protected storage location using an incorrect storage
    access key.

  - An attempt to store, in the access-register mode, by means of an access-list
    entry which has the fetch only bit set to one.

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

  - An attempt to store into a protected page with DAT on.

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

NOTE: Source code information for program HFZVCDB2 could not be presented
      because no compiler listing or side-file data sets were provided. The
      source line # from the GONUMBER option is 123 for offset X'C74'.

A complete sample report from running this IVP is provided as member HFZSRP04 in the HFZ.SHFZDOC1 data set.

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