Start of changeStart of change

The current channel

A program's current channel is the channel (if any) with which it was invoked. The program can create other channels. However, the current channel, for a particular invocation of a particular program, does not change. It is analogous to a parameter list.

Start of change

Current channel example, with LINK commands

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 isn't started by a program and doesn't have a current channel.

B, C, D, and E are second-, third-, fourth-, and fifth-level programs, respectively.

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 doesn't pass it one.

Program E's current channel is Y, passed by the CHANNEL option on the EXEC CICS LINK command issued by D.

Figure 47. Current channel: example with LINK commands
The picture shows the scenario described in the text.

The following table lists the name of the current channel (if any) of each of the five programs shown in the previous figure.

Table 9. The current channels of interactive programs--example with LINK commands
Prog. Current CH Issues commands Comments
A None
.
EXEC CICS PUT CONTAINER(ONE) 
          CHANNEL(X) FROM(area1)
EXEC CICS PUT CONTAINER(TWO) 
          CHANNEL(X) FROM(area2)
EXEC CICS LINK PROGRAM(B) CHANNEL(X)
.
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 doesn't 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
.
EXEC CICS PUT CONTAINER(THREE) 
          FROM(area-a)
EXEC CICS DELETE CONTAINER(TWO)
EXEC CICS LINK PROGRAM(C) CHANNEL(X)
.
.
EXEC CICS RETURN
Program B modifies channel X (its current channel) by adding and deleting containers, and passes the modified channel to program C.

Program B doesn't need to specify the CHANNEL option on the PUT CONTAINER and DELETE CONTAINER commands; its current channel is implied.

C X
.
EXEC CICS LINK PROGRAM(D)
.
.
EXEC CICS RETURN
Program C links to program D, but does not pass it a channel.
D None
.
EXEC CICS PUT CONTAINER(first) 
          CHANNEL(Y) FROM(a1)
EXEC CICS PUT CONTAINER(second) 
          CHANNEL(Y) FROM(a2)
EXEC CICS LINK PROGRAM(E) CHANNEL(Y)
.
.
EXEC CICS RETURN
Program D creates a new channel, Y, which it passes to program E.
E Y
.
RETURN
.
Program E performs some processing on the data it's been passed and returns.
End of changeStart of change

Current channel example, with XCTL commands

Figure 48 shows four interactive programs. A1 is a top-level program started by, for example, a terminal end-user. It isn't started by a program and doesn't 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 doesn't 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.

Figure 48. Current channels--example, with XCTL commands
The picture shows the scenario described in the text.

The following table lists the name of the current channel (if any) of each of the four programs shown in Figure 48.

Table 10. The current channels of interactive programs--example
Program Current channel Issues command
A1 None
.
EXEC CICS LINK PROGRAM(B1) CHANNEL(X)
.
B1 X
.
EXEC CICS XCTL PROGRAM(B2)
.
B2 None
.
EXEC CICS XCTL PROGRAM(B3) CHANNEL(Y)
.
B3 Y
.
EXEC CICS RETURN
.
End of changeStart of change

Current channel: START and RETURN commands

Besides EXEC CICS LINK and XCTL, two other commands can be used to invoke a program and pass it a channel:

EXEC CICS START TRANSID(tranid) CHANNEL(channel-name)
The program that implements the started transaction (or the first program, if there are more than one) is passed the channel, which becomes its current channel.
EXEC CICS RETURN TRANSID(tranid) CHANNEL(channel-name)
The CHANNEL option is valid only:

The program that implements the next transaction is passed the channel, which becomes its current channel.

End of changeEnd of changeEnd of change [[ Contents Previous Page | Next Page Index ]]