Start of changeStart of change

Using channels: some typical scenarios

Channels and containers provide a powerful way to pass data between programs. This section contains some examples of how channels can be used.

Start of change

One channel, one program

Figure 43 shows the simplest scenario--a "standalone" program with a single channel with which it can be invoked.

Figure 43. A standalone program with a single channel
The picture shows a single program being invoked by an EXEC CICS LINK PROGRAM('payr') CHANNEL('payroll') call.
End of changeStart of change

One channel, several programs (a component)

In Figure 44, there is a single channel to the top-level program in a set of inter-related programs. The set of programs within the shaded area can be regarded as a "component". The client program "sees" only the external channel and has no knowledge of the processing that takes place nor of the existence of the back-end programs.

Inside the component, the programs can pass the channel between themselves. Alternatively, a component program could, for example, pass a subset of the original channel, by creating a new channel and adding one or more containers from the original channel.

Figure 44. A "component"--a set of related programs invoked through a single external channel. "CH" indicates that the programs within the component can pass channels between themselves.
The picture shows a shaded area representing a component. Within the shaded area are several programs that interact with one another. A client program, outside the shaded area, issues an EXEC CICS LINK PROGRAM('payr') CHANNEL('payroll') call to invoke the top-level program within the component.
End of changeStart of change

Several channels, one component

As in the previous example, we have a set of inter-related programs that can be regarded as a component. However, this time there are two, alternative, external channels with which the component can be invoked. The top-level program in the component issues an EXEC CICS ASSIGN CHANNEL command to determine which channel it has been invoked with, and tailors its processing accordingly.

The "loose coupling" between the client program and the component permits easy evolution. That is, the client and the component can be upgraded at different times. For example, first the component could be upgraded to handle a third channel, consisting of a different set of containers from the first or second channels. Next, the client program could be upgraded (or a new client written) to pass the third channel.

Figure 45. Multiple external channels to the same component. "CH" indicates that the programs within the component may pass channels between themselves.
The picture shows a shaded area representing a component. A client program, outside the shaded area, issues an EXEC CICS LINK PROGRAM('payr') CHANNEL('private-payroll') call to invoke the top-level program within the component. A second client program issues an EXEC CICS LINK PROGRAM('payr') CHANNEL('public-payroll') call. The top-level program issues an EXEC CICS ASSIGN CHANNEL command to determine which channel it has been invoked with.
End of changeStart of change

Multiple interactive components

Figure 46 shows a "Human resources" component and a "Payroll" component, each with a channel with which it can be invoked. The Payroll component is invoked from both a standalone program and the Human resources component.

Figure 46. Multiple components which interact through their channels
The picture shows a Human resources component and a Payroll component, each with a channel through which it can be invoked. The Payroll component is invoked from both a standalone program and the Human resources component.
End of changeEnd of changeEnd of change [[ Contents Previous Page | Next Page Index ]]