Exit programs and the CICS storage protection facility

When you are running CICS® with the storage protection facility, there are two points you must consider for task-related user exits; the execution key in which your task-related user exit programs run and the storage key of data storage obtained for your exit programs.

Execution key for task-related user exit programs

When you are running with storage protection active, CICS always starts task-related user exit programs in CICS key. Even if you specify EXECKEY(USER) on the program resource definition, CICS forces CICS key when it passes control to the TRUE. However, if a task-related user exit program itself passes control to another program (through a link or transfer-control command), the program starts according to the execution key (EXECKEY) defined in its program resource definition.

Important: You must specify EXECKEY(CICS) when defining both task-related user exit programs, and programs to which an exit program passes control.

Data storage key for task-related user exit programs

The storage key of storage used by task-related user exit programs depends on how the storage is obtained:
  • Global or local work areas specified when an exit program is enabled, are always in CICS key.
  • Any working storage obtained for the exit program is in the key set by the TASKDATAKEY of the transaction under which the exit program is started.
  • Task-related user exit programs can use EXEC CICS commands to obtain storage by issuing:
    • Explicit EXEC CICS GETMAIN commands
    • Implicit storage requests as a result of EXEC CICS commands that use the SET option.

    The default storage key for storage obtained by EXEC CICS commands is set by the TASKDATAKEY of the transaction under which the exit program is started.