LINK and XCTL
Two CICS commands for running another program: LINK runs it and comes back, XCTL hands over and does not come back.
Also written EXEC CICS LINK, EXEC CICS XCTL, transfer control, DPL, distributed program link
CICS programs often pass work to other programs. There are two commands for this, and the difference is whether control comes back.
EXEC CICS LINK PROGRAM('ACCTCHK') COMMAREA(WS-DATA) runs ACCTCHK and waits. When ACCTCHK ends with RETURN, the first program continues from the next statement, with any results ACCTCHK put in the COMMAREA. It is like a COBOL CALL.
EXEC CICS XCTL PROGRAM('ACCTMENU') transfers control. The first program ends and its storage is freed, and ACCTMENU carries on in its place. When ACCTMENU returns, control goes to whatever was above the first program, not to the first program itself. XCTL is often used to move between the screens of an application, such as from a menu to a detail screen.
Both can pass data with a COMMAREA, or with channels and containers in newer programs. A LINK can also run a program in a different CICS region, which is called a distributed program link, or DPL.
Where can I learn this hands-on?
Right here, at ZedBank. You take a junior job at a simulated bank and learn each part of the work by doing it, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- EXEC CICSThe way a program asks CICS to do something, such as read a record, send a screen or call another program.
- COMMAREAThe communication area: a block of data a CICS program passes to another program, or keeps for the next step of a conversation.
- CICS transactionOne unit of online work in CICS: the whole exchange of receiving a request, doing the work, and sending a response.
- CALLThe COBOL statement that runs another program and passes data to it, then continues when that program returns.
- CICSThe transaction manager that runs online mainframe applications, and the software behind a great many screens bank staff use.