The scope of a channel
The scope of a channel is the code from which it can be accessed. These examples show the scope of each channel in the diagram.
The scope is important because it defines the lifetime of the channel and container storage. For more information, see Deleting channels and containers and freeing their storage. For more information about LINK commands, see Current channel example, with LINK commands.
Scope example, with LINK commands
The scope of the X channel is programs A, B, and C. The scope of the Y channel is programs D and E.
Neither of these channels is the transaction channel DFHTRANSACTION. The scope of DFHTRANSACTION is the whole transaction.
By the time program B returns control to program A, the X channel has been modified - it does not contain the same set of containers as when it was created by program A.
The following table lists the name and scope of the current channel (if any) of each of the five programs discussed previously.
Program | Current channel | Scope of channel |
---|---|---|
A | None | Not applicable |
B | X | A, B, C |
C | X | A, B, C |
D | None | Not applicable |
E | Y | D, E |