To perform a COBOL Call from one CICS program to another COBOL program.
The called program must be link edited with the calling program. If many programs are calling the same program, this will result in more memory occupation.
Program can be called in two ways:
Static Call
Dynamic Call
A statically called program does not require to be registered in PPT.
The Caller and the Called Program must be link-edited together into a single load module.
The dynamic call is available only in VS-COBOL II and CICS 2.1 or later. Dynamically called programs are separate load modules and are therefore shareable by multiple callers. During execution, CICS will dynamically load the called program.
The dynamically called program requires to be registered in PPT.
This is an example of COBOL program using a static call. The format described for passing parameters holds true for dynamic calls as well.
The first two parameters in the CALL must be DFHEIBLK and DFHCOMMAREA (in that order), and then user defined variables will follow.
The translator always inserts DFHEIBLK in the LINKAGE SECTION.
The called program should issue a GOBACK to return to caller.
CALL | XCTL/LINK |
---|---|
The CALL’ed program is Link edited along with the main module. | The XCTLed/LINKed program(s) is separately compiled and link edited. |
Higher module size and higher memory requirement | Dynamic loading may slow down execution speed |
Any changes in the CALL’ed program require compiling of all other modules using the CALL’ed program | Changes in XCTLed/LINKed program(s) will not affect other modules using this |
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!