Current channel example, with XCTL commands
This example shows how a program passes the current channel and its containers to another program using the EXEC CICS XCTL command.
Figure 1 shows four interactive programs. A1 is a top-level program started by, for example, a terminal user. It is not started by a program and does not have a current channel. B1, B2, and B3 are all second-level programs.
B1's current channel is X , passed by the CHANNEL option on the EXEC CICS LINK command issued by A1.
B2 has no current channel, because B1 does not pass it one.
B3's current channel is Y , passed by the CHANNEL option on the EXEC CICS XCTL command issued by B2.
When B3 returns, channel Y and its containers are deleted by CICS.

The following table lists the name of the current channel (if any) of each of the four programs shown in Figure 1.
| Program | Current channel | Issues command |
|---|---|---|
| A1 | None |
|
| B1 | X |
|
| B2 | None |
|
| B3 | Y |
|