Current channel example, with LINK commands
This example shows how a program passes the current channel and its containers to another program using the EXEC CICS LINK command.
The following figure illustrates the origin of a program's current channel. It shows five interactive programs. Program A is a top-level program started by, for example, a terminal end user. It is not started by a program and does not have a current channel.
B, C, D, and E are second-, third-, fourth-, and fifth-level programs.
Program B's
current channel is X
, passed by the CHANNEL option
on the EXEC CICS LINK command issued by program A. Program B modifies
channel X by adding one container and deleting another.
Program C's
current channel is also X
, passed by the CHANNEL
option on the EXEC CICS LINK command issued by program B.
Program D has no current channel, because C does not pass it one.
Program E's
current channel is Y
, passed by the CHANNEL option
on the EXEC CICS LINK command issued by D.
The following table lists the name of the current channel (if any) of each of the five programs shown in the previous figure.
Prog. | Current CH | Issues commands | Comments |
---|---|---|---|
A | None |
|
Program A creates channel X and passes it
to program B. Note that, by the time control is returned to program A by program B, the X channel has been modified—it does not contain the same set of containers as when it was created by program A. (Container TWO has been deleted and container THREE added by program B.) |
B | X |
|
Program B modifies channel X (its current
channel) by adding and deleting containers, and passes the modified
channel to program C. Program B does not need to specify the CHANNEL option on the PUT CONTAINER and DELETE CONTAINER commands; its current channel is implied. |
C | X |
|
Program C links to program D, but does not pass it a channel. |
D | None |
|
Program D creates a new channel, Y, which it passes to program E. |
E | Y |
|
Program E performs some processing on the data it's been passed and returns. |