Several channels, one component

This example shows a set of related programs (a component) which can be invoked through two alternative channels.

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 1. Multiple external channels to the same component. CH indicates that the programs within the component can 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.