Invoking more than one exit program at a single exit

You can invoke more than one exit program from a single global user exit point.

Although such programs can work independently, you should note the following points:
  • An exit program is only called at an exit if it has been made available for execution with the START option of the EXEC CICS ENABLE command. The order of invocation, when more than one exit program has been started at an exit point, is the order in which the programs were activated (that is, the order in which the EXEC CICS ENABLE commands associated them with the exit point). When programs work on the same data area, you should consider the order in which they are invoked. For example, in a terminal control output exit, an exit program might manipulate the same message in different ways, depending on the way an earlier exit program acted.
  • Return code management is more complicated than it is for single programs. Each exit program sets a return code in register 15 as usual. The second and subsequent programs invoked from a single exit point can access the return code value set by the preceding program (the current return code) using the parameter UEPCRCA of DFHUEPAR.
    The following rules apply to return codes if a number of user exit programs set return code values when invoked on a single exit:
    • If a user exit program supplies the same return code value as the previous program (addressed by UEPCRCA), then CICS® acts on that value.
    • If a user exit program supplies a different return code value from the previous program (addressed by UEPCRCA), CICS ignores both values and resets the “current return code” to the default value, usually UERCNORM, before calling any further exit programs for that exit point.
    • If a user exit program sets an eligible value in register 15 and changes the “current value” field to match (as addressed by UEPCRCA), the new value is adopted and passed on to the next program (if any), or back to the calling CICS module or domain.
      The following code snippet shows how an exit program can set a different return code from the “current return code”, returned by a previous exit program, and cause CICS to act on the new code.
                 LA    R15,UERCTDOK  Set the contents of reg 15 to a value of 4
                 L     R6,UEPCRCA    Set reg 6 to the address of the half word
      *                              containing the current return code
                 STH   R15,0(,6)     Store the new return code at the location
      *                              of the current return code.
               . . .