Module 8: CICS Program and Data Passing
XCTL
What the XCTL command does
- XCTL transfers control from one program to another program.
- The new program runs at the SAME logical level as the current program.
- Control does NOT come back. The current program ends when XCTL runs.
- Think of it as a one-way transfer. The old program is finished.
- Data is passed with the COMMAREA or CHANNEL option, just like LINK.
- When the new program issues RETURN, control goes to the program at the next higher logical level.
When to use XCTL
XCTL and logical levels
- LINK moves control down one logical level. XCTL stays on the same level.
- Because XCTL does not add a level, chaining many programs with XCTL uses less storage than nesting LINKs.
- A program reached by XCTL that issues RETURN returns to the program one level above, not to the XCTL issuer.
- This is why XCTL is a clean way to end error processing. The error program RETURNs and the whole task ends.
MainframeBug Assistant