Module 8: CICS Program and Data Passing
Static vs Dynamic Calls
Static calls
- A static call uses a program name written as a literal in the COBOL CALL statement.
- The called program is link-edited into the same load module as the caller.
- Static calls are faster because the program is already in storage. No load is needed at run time.
- The downside is a bigger load module and less flexibility. Changing the called program means re-linking the caller too.
- Example:-* Static call - program name is a literal CALL 'PROG2' USING WS-PARM.
Dynamic calls
- A dynamic call uses a variable for the program name in the COBOL CALL statement.
- The called program is loaded from the load library at run time, when the CALL runs.
- Dynamic calls are flexible. You can change the called program without re-linking the caller.
- The downside is the load cost on the first call, and the program must exist in the load library.
- If a dynamically called program abends, normal CICS abend handling may not catch it the way it does for LINKed programs.
- Example:-* Dynamic call - program name is a variable MOVE 'PROG2' TO WS-PROG-NAME. CALL WS-PROG-NAME USING WS-PARM.
Static and dynamic calls under CICS
- You can make static or dynamic COBOL calls from a CICS program.
- A static or dynamic call does not incur the CICS program-control overhead that LINK and XCTL have.
- But a COBOL-called program is not a separate CICS program. It runs as part of the caller.
- Use EXEC CICS LINK when you want CICS to manage the program as a separate logical level.
- Use COBOL CALL when the subprogram is just a subroutine with no CICS commands of its own.
