Register handling in the task-related user exit program

When you write your task-related user exit program you must understand the different register types; CICS registers, the calling program's registers and RMI registers. CICS registers are used by the CICS management module that handles task-related user exits. The calling program's registers are registers used by the calling program, and are addressed by parameter UEPHMSA of DFHUEPAR. RMI registers are used by the called resource management interface (RMI).

Saving CICS registers

Start your task-related user exit program by saving the contents of the CICS® registers. Register 13 addresses an 18-word area into whose fourth and subsequent words your exit program must store registers 14 through 12. Three of the saved values have significance, as follows:
  • The saved contents of register 14 contain the address within CICS to which the task-related user exit program returns control.
  • The saved contents of register 15 contain the address at which the task-related user exit program has been entered.
  • The saved contents of register 1 address the parameter list (DFHUEPAR) that is provided by CICS for the task-related user exit program.
Note: As a rule, if you fail to understand the origin or the purpose of a call, you must:
  1. Restore any registers that you have used to the state they were in on entry to your code
  2. Return to the address contained in CICS register 14.

The calling program's registers

The calling program's registers are stored at the address specified by UEPHMSA of DFHUEPAR. Where the calling program is a CICS management program, for example the sync point manager, the only caller registers that have significance are registers 1 and 15. Register 1 addresses the calling program's parameter list. CICS sets the calling program's register 15 to zero before the task-related user exit program is started. The calling program's register 15 can sometimes be used to pass responses back to the calling program from the task-related user exit program, depending on the identity of the caller. If the calling program is a CICS management program, and the register is still zero on return, CICS assumes that its call was not understood. If the calling program is an application program, the significance of register settings on return are either described in the documentation of your resource manager or defined locally.