Using CICS services in your task-related user exit program

You can invoke CICS® services by issuing CICS API commands in your exit program.

However, you should take note of the following:
  • If your program is invoked because of a CICS abend, it must not use any CICS services. See Coding a program to be invoked at CICS termination.
  • EXEC CICS commands that cause an XCTL (either directly or implied)—for example, EXEC CICS XCTL or EXEC CICS SHUTDOWN—must never be used.
  • DFHEIENT and DFHEIRET must be in your program. But see the note about not using DFHEIENT in abend invocations, in Limitations of task-related user exits during CICS shutdown. For further details of the DFHEIENT and DFHEIRET macros, see DFHECALL macro.
  • If your exit program entry point is immediately followed by an occurrence of a DFHEIENT macro, inserted either implicitly by CICS or explicitly in the program, then the expansion of the DFHEIENT macro stores incorrect values at DFHEIBP and DFHEICAP. Your code can subsequently correct this by copying UEPEIB into DFHEIBP, reloading the EIB base register (DFHEIBR) from UEPEIB, and setting DFHEICAP to X'80000000'. For example,
    TESTPROG DFHEIENT CODEREG=2,EIBREG=11,DATAREG=10
             USING DFHUEPAR,1
             MVC   DFHEIBP,UEPEIB              Get correct EIB address
             L     DFHEIBR,UEPEIB              Reload EIB base register
             MVC   DFHEICAP,=X'80000000'
    Note that the entry point of a program does not have to be at the start of the program and can be positioned after the DFHEIENT macro.
  • The DFHEIENT macro allocates dynamic storage to be mapped by the DFHEISTG DSECT. You must return to CICS by means of the DFHEIRET macro, which frees the dynamic storage.
  • Command-level calls use registers 0, 1, 14, and 15.
  • Do not issue a syncpoint in start-of-task, end-of-task, or syncpoint invocations.
  • On each invocation of a task-related user exit program, a new EXEC environment is created, even when the program is being invoked from the same task. This means that CICS operations, such as browse of a resource definition table, cannot be continued from one invocation of the exit program to the next.