Writing a request validation exit

The DB2 UDB Option for CICS calls the request validation exit before a request is executed by the DB2 UDB Option for CICS. The exit program examines the Exit Communication Area passed by the DB2 UDB Option for CICS. Based on the information in the XACTION field description, the exit program either passes, fails, or modifies the request.

The request validation exit can be either a separate program or combined with the result validation program. You can check the XREASON field to determine the reason for the call.

See the following section, “Writing a result validation exit,” for details on writing a result validation exit.

Table 7-2 shows the communication area fields that pertain to the request validation exit.

Table 7-2: Request Validation Communication Area fields

Field

Description

XREASON

A header containing the word REQUEST.

XREQNAME

The name of the request.

XREQFUNC

The request function. Valid values are SELECT, UPDATE, USE, and so on, which are taken from the SQL statement. The first word of the SQL statement is not used anymore.

XREQOPT

The request option. Valid values are PREVIEW and REPORT, which are taken from the SQL statement.

XREQADDR

The address of the request buffer. The request buffer is formatted as a half-word length field followed by the request.

XACTION

This field is blank when the DB2 UDB Option for CICS sends it on to DB2. If you specify it, the exit program can place a value in this field to indicate what action the DB2 UDB Option for CICS takes:

  • If you leave this field blank, the DB2 UDB Option for CICS does nothing. Processing proceeds in the normal fashion.

  • If you specify IGNORE, the DB2 UDB Option for CICS ignores the request, and processing continues with the next request in the request queue. This request is not treated as an error condition.

  • If you specify REJECT, the DB2 UDB Option for CICS rejects the request. This request is treated as an error condition.

If a request is ignored or rejected, the DB2 UDB Option for CICS issues an appropriate error message when the results return to the client application. If you specify it, the exit program can supply an additional error message in the XERRMSG field.

XERRMSG

This field is blank.

The values for the request validation exit fields are shown throughout the example in “Understanding the Exit Communication Area”.