Returning values to CICS

At some exit points, you can influence what CICS® does on return from an exit program by supplying a return code value.

About this task

You must set the return code value in register 15 before leaving the exit program.

Procedure

  • Use character string values rather than using hard-coded values.
    Character strings equating to valid return code values are provided with the parameter list for each exit point.
    For example, at exit XMNOUT in the monitor domain, you are presented with the address of a monitoring record. If you decide in your exit program that this record should not be written to SMF, you can set the return code value UERCBYP (meaning bypass this record) before returning to CICS and CICS suppresses the record.
  • If you have more than one exit program running for an exit point, use parameter UEPCRCA of DFHUEPAR to set the return code.
  • If your exit program issues an EXEC CICS command and use the DFHEIENT macro, you must use this macro to set the return code.
    The DFHEIRET macro:
    • Restores registers
    • Places a return code in register 15 after the registers are restored
    • Returns control to the address in register 14.
    For example:
    DFHEIRET RCREG=nn
    where nn is the number of any register (other than 13) that contains the return code to be placed in register 15 after the registers are restored.

Results

If you supply a return code value that is not expected at a particular exit point, the default return code indicating a normal response (usually UERCNORM) is assumed, unless you set the return code UERCPURG. You are strongly advised not to let the return code default to the normal response as the result can be unpredictable. The normal response tells CICS to continue processing as if the exit program had not been invoked, and it is a valid option at most global user exit points. The exceptions are shown in the list of return codes provided with each exit description.