Linking and passing control to other programs (CICS online programs only)
Use CICS® to link your program to other programs without losing access to the facilities acquired in the linking program.
For example:
- You could schedule a PSB and then link to another program using a
LINK
command. On return from that program, the PSB is still scheduled. - Similarly, you could pass control to another program using the
XCTL
command, and the PSB remains scheduled until that program issues an EXEC CICS RETURN statement. However, when you pass control to another program usingXCTL
, the working storage of the program passing control is lost. If you want to retain the working storage for use by the program being linked to, you must pass the information in the COMMAREA.
Recommendation: To simplify your work, instead of linking to another
program, you can issue all DL/I requests from one program module. This helps to keep the programming
simple and easy to maintain.
Terminating a PSB or issuing a sync point affects the linking program. For example, a terminate request or sync point that is issued in the program that was linked causes the release of CICS resources enqueued in the linking program.