Previous Topic: Default ProcessingNext Topic: Building on z/OS


Customizing the Exit

Copy member TIRTERBX from the CA Gen CEHBSAMP library to a separate library. The status code returned from TIRTERBX is used to control abend processing as shown in the following table:

Status Code Returned to TIRTERBX

TIRFAIL Writes Messages to Error File

TIRFAIL Abends Job with U0100

0

Yes

Yes

1

No

Yes

2

No

No

(blank)

Yes

Yes

CA Gen batch jobs usually handle errors by first writing error messages to a file and then abending with a code of U0100. Upon entry to TIRTERBX, the TERM-STATUS-CODE is blank. By setting this field to 1, you can override the error message processing but TIRFAIL still abends the job with a code of U0100. You can override the message processing and control the abend of the job by setting the TERM-STATUS-CODE to 2.

Important! If you set TERM-STATUS-CODE to 1 or 2, CA Gen does not write error messages to a file. You should implement your own routine to write error messages to a file so that you can see the nature of any errors that occur. Be sure to include the use of DSNTIAR for display of DB2 messages. If you set TERM-STATUS-CODE to 2, you are responsible for abending the job.

One way of doing this is to code:

CALL ’TIRABEND’ USING ABEND-CODE

where ABEND-CODE is defined as:

01 ABEND-CODE PIC S9(9) COMP VALUE +100

The termination exit source contains example code for each of these status codes, with the code for 1 and 2 commented out. The parameters passed between the fail routine and the termination exit are defined in copy member CBLTERM, which is also in the CEHBSAMP library.

When you have completed your modifications, install the exit as described earlier in the section on customizing user exits in this chapter.