Module 2: CICS Architecture
CICS Program Manager
The program manager is the Program Control Program, DFHPCP. It loads your programs, passes control between them with LINK and XCTL, and loads fresh copies with NEWCOPY.
What is the program manager
- The program manager is the Program Control Program, DFHPCP - part of the CICS nucleus.
- It loads your programs and BMS maps from the DFHRPL libraries into storage the first time they are used.
- It keeps the PPT entries: program name, language, where the program lives, and whether it is currently loaded.
- When you change a program, NEWCOPY or PHASEIN tells CICS to load the fresh copy.
LINK - call a program and come back
- EXEC CICS LINK calls another program like a subroutine. When the called program ends, control returns to the caller.
- Data is passed in a COMMAREA (communication area) of up to 32K.
- The called program receives the COMMAREA through DFHCOMMAREA in its LINKAGE SECTION.
- Use LINK for subprograms: validation routines, calculations, common edits.
XCTL - transfer control permanently
- EXEC CICS XCTL transfers control to another program. Control does NOT come back to the caller.
- Used to chain programs - for example a menu program XCTLs to the application program the user selected.
- A COMMAREA can also be passed with XCTL.
- Because there is no return, the calling program should do its cleanup before the XCTL.
LOAD, RELEASE and RETURN
- EXEC CICS LOAD loads a program or table into storage and gives you its address. RELEASE frees it again.
- EXEC CICS RETURN ends the program. RETURN with TRANSID starts the next transaction (pseudo-conversation). A plain RETURN ends the task.
- After a program is changed and recompiled, use CEMT SET PROGRAM(name) NEWCOPY (or PHASEIN) so CICS picks up the new version.
- PHASEIN is gentler than NEWCOPY: tasks already running keep the old copy while new tasks get the new one.
Example - LINK with a COMMAREA in COBOL
- The main program calls the order-validation subprogram and passes the order record in the COMMAREA.
- * Call the order-validation subprogram, then continue here EXEC CICS LINK PROGRAM('ORDVALDT') COMMAREA(WS-ORDER-REC) LENGTH(LENGTH OF WS-ORDER-REC) END-EXEC * Control returns here when ORDVALDT ends
- LENGTH tells CICS how many bytes of the COMMAREA to pass. Always set it - never leave it out.
- The called program must define DFHCOMMAREA in its LINKAGE SECTION with the same layout.
