Program Control


A task may need to execute multiple programs in sequence to complete its work. A transaction can initiate only one program, while a program can call several other programs during its execution.

Program-to-program calls can occur in various ways depending on the specific requirements of the calling program. When the calls happen, the control transfers from calling program to called program in different ways. i.e., some of the calling programs may expect the control back, and some of them may not.

For the different kinds of requirements mentioned above, different CICS commands are defined. They are called Program Control Commands, and those are listed below –

Command Description
LINK It is used to call another CICS program from the currently executing program. The control is temporarily transferred to the called program, and once the called program completes, control is returned to the original program.

It is used to call another CICS program in a separate CICS region and expects control back. This is referred as Distributed Program Link (DPL).

The COMMAREA, CHANNEL, and INPUTMSG options of the LINK command allows to pass the data between the programs. However, INPUTMSG and INPUTMSGLEN options can't be used with LINK command when using DPL.
XCTL It is used to transfer control permanently from one program to another. Unlike the LINK command, XCTL does not return control to the calling program.

It is used to call another CICS program in a separate CICS region and wont expects control back.

The COMMAREA, CHANNEL, and INPUTMSG options of the XCTL command allows to pass the data between the programs. However, INPUTMSG and INPUTMSGLEN options can't be used with XCTL command when using DPL.
RETURN It is used to end a transaction or pass control to another program or transaction.

The COMMAREA, CHANNEL, and INPUTMSG options of the RETURN command allows to pass the data between the programs or transactions. However, INPUTMSG and INPUTMSGLEN options can't be used with RETURN command when using DPL.
LOAD It is used to dynamically load a program, mapset, or table into main memory at runtime.
RELEASE It is used to remove a program, table, or mapset that was previously loaded into main memory with a LOAD command.
CALL It is used to invoke another program that is at the same level or a lower level, with the expectation that control will return to the calling program.