The first step when CICS initiates a task, it loads corresponding program and transfers control it. That program will then invokes other programs. And these sends control back to the invoked program and then to CICS. In some cases, the control goes back to the program of next higher logical level. And then to the initial program (returns control to CICS).
The programs within a task can execute at different logical levels. When a program is invoked by CICS, for example, that program operates at the logical level below CICS. Then, that program can invoke another program using the XCTL command
If the program is invoked with a LINK command, it operates at the logical level below the invoking program.
If the program is invoked with an XCTL command, though, the invoked program operates at the same logical level as the invoking program. You May Also Like: CICS Tough Interview Questions.
Logical Levels in CICS
- CICS is at the highest logical level (level 0). When CICS invokes Program A, that program runs at the next lower level, level 1. When Program A issues a RETURN command, control returns to CICS at level 0. Notice that this RETURN command may or may not include a trans-id.
- Similarly, when Program A invokes Program B using a LINK command, Program B runs at the level below Program A (level 2 in this example). And when Program B issues a RETURN command (without a trans-id), control is passed back up to Program A.
- In contrast, when Program B invokes Program C using an XCTL command, Program C operates at the same logical level as Program B. Then, when Program C issues a RETURN command (without a trans-id), control returns not to Program B, but to the program that invoked Program B
Alternative to XCTL and LINK
CICS using a COBOL Call statement. And you can return control to an invoking program using a COBOL Goback statement.
Frankly, you’re not likely to use the Goback statement in place of the RETURN command. But you may use the Call statement instead of the LINK command to invoke subprograms that are used more than once within the same execution of a program.
You need to use only RETURN command in CICS programs.
2 thoughts
Comments are closed.