Writing a result validation exit

A corresponding result validation exit runs after all the requested results have been written to temporary storage. The result validation exit deals with the result as a whole, not row-by-row.

The exit program can examine the Exit Communication Area that the DB2 UDB Option for CICS passes to it. Based on the information in the communication area, the exit program can either pass or fail the result.

Table 7-3 shows the communication area fields that pertain to the result validation exit.

Table 7-3: Result validation communication area fields

Field

Description

XREASON

A header containing the word RESULT.

XRESNAME

The name of the result.

XRESOPT

The result option. The valid value is PREVIEW.

XRESTYPE

The result type. The valid value is OUT.

XRESCODE

The DB2 return code.

XRESROWS

The size of the result in rows.

XRESSIZE

The size of the result in bytes.

XRESQNAM

The queue name of the result file.

XACTION

This field is blank when the DB2 UDB Option for CICS sends it on. The exit program can place a value in this field to indicate which of the following actions 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 or REJECT, the DB2 UDB Option for CICS bypasses this result, which means the result exit is called once per result, not once for each row. It does not return the result to the client application. The results might also be rejected if a row count is exceeded.

XERRMSG

The error message or blank. If you want an additional error message in the XERRMSG field, the exit program can supply it.

NoteIf you use a result exit, set Temp storage queue type to AUX or MAIN at the DB2 UDB Option Configuration window (see “Temp storage queue type”). The result exit is not called when Temp storage queue type is set to NONE.

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