Calling subprograms from COBOL programs

In a CICS® system, when control is transferred from the active program to an external program, but the transferring program remains active and control can be returned to it, the program to which control is transferred is called a subprogram. In COBOL, there are three ways of transferring control to a subprogram.

EXEC CICS LINK
The calling program contains a command in one of these forms:
EXEC CICS LINK PROGRAM('subpgname')
EXEC CICS LINK PROGRAM(name)
In the first form, the called subprogram is specified as an alphanumeric literal. In the second form, name refers to the COBOL data area with length equal to that required for the name of the subprogram.
Static COBOL call
The calling program contains a COBOL statement of the form:
CALL 'subpgname'
The called subprogram is explicitly named as a literal string.
Dynamic COBOL call
The calling program contains a COBOL statement of the form:
CALL identifier
The identifier is the name of a COBOL data area that must contain the name of the called subprogram.

For information about the performance implications of using each of these methods to call a subprogram, see the Enterprise COBOL for z/OS: Programming Guide, and Enterprise COBOL Version 4 Release 2 Performance Tuning (https://www.ibm.com/support/docview.wss?uid=swg27018287).

COBOL programs can call programs in any language supported by CICS, statically or dynamically. LINK or XCTL are not required for inter-language communication, unless you want to use CICS functions such as COMMAREA. See Mixing languages in Language Environment for more information about inter-language communication.

The contents of any called or linked subprogram can be any function supported by CICS for the language (including calls to external databases, for example, DB2® and DL/I), with the exception that an assembler language subprogram cannot CALL a lower level subprogram.