Scope example, with LINK and XCTL commands
This example adds to the diagram from
Current channel
example, with XCTL commands
to show the scope of each channel.
For more information about XCTL commands, see Current channel example, with XCTL commands.
Figure 1 shows the same four interactive programs previously described, plus a third-level program, C1, that is invoked by an EXEC CICS LINK command from program B1.
The scope of the X channel is restricted to A1 and B1.
The scope of the Y channel is B2 and B3.
The scope of the Z channel is B1 and C1.
None of these channels is the transaction channel DFHTRANSACTION, the scope of which would be the whole transaction.
Note that, by the time control is returned to program A1 by program B3, it is possible that the X channel can have been modified by program B1, it might not contain the same set of containers as when it was created by A1.

The following table lists the name and scope of the current channel (if any) of each of the five programs shown in Figure 1.
| Program | Current channel | Scope of channel |
|---|---|---|
| A1 | None | Not applicable |
| B1 | X | A1 and B1 |
| B2 | None | Not applicable |
| B3 | Y | B2 and B3 |
| C1 | Z | B1 and C1 |