User-replaceable programs and the storage protection facility
When you are running CICS with the storage protection facility, you must decide the execution key in which your program runs and the storage key of data storage that is obtained by your program.
Execution key for user-replaceable programs
When you are running with storage protection active, CICS® gives control to user-replaceable programs in CICS key.Even if you specify EXECKEY(USER) on the PROGRAM resource, CICS forces CICS key when it calls the program. However, if a user-replaceable program itself passes control to another program, the called program runs according to the execution key (EXECKEY) defined in its PROGRAM resource.
Data story key for user-replaceable programs
- The communication area passed to the user-replaceable program by its caller is always in CICS key.
- Any working storage obtained for the user-replaceable program is in the key set by the TASKDATAKEY of the transaction under which the program is started.
- User-replaceable 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 user program is started.
As an example, consider a transaction defined with TASKDATAKEY(USER) that causes a user-replaceable program to be called. In this case, any implicit or explicit storage acquired by the user program with an EXEC CICS command is, by default, in user-key storage. However, on an EXEC CICS GETMAIN command, the user program can override the TASKDATAKEY option by specifying either CICSDATAKEY or USERDATAKEY.