z/OS Communications Server: SNA Programming
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Continue-any mode versus continue-specific mode

z/OS Communications Server: SNA Programming
SC27-3674-00

In the example in Figure 1, the communication macroinstructions are issued synchronously. The application program handles each inquiry serially, never accepting a new inquiry until it has completed the previous one. Although this procedure might be suitable for application programs that deal with short inquiries and a few sessions, most application programs require handling inquiries in parallel.

An application program that handles more than one inquiry concurrently can use asynchronous request handling and issue new RECEIVEs in the any-mode before the previous inquiry is completed. For an example, see Sample Program 2 in Logic of a more complicated application program. This, however, raises the possibility that both a RECEIVE for a specific session and a RECEIVE for any session (which includes the specific session as well) might be waiting for data at the same time. Consequently, data that is meant to satisfy the subroutine's RECEIVE might instead be intercepted by RECEIVE in the mainline program, which is meant only to receive new inquiries.

To eliminate this sort of problem, VTAM® allows the application program to indicate when a particular session's input can be received by a RECEIVE macroinstruction issued in the any-mode, and when the input must be received by a RECEIVE macroinstruction issued in the specific-mode. The former is called continue-any mode (CA), and the latter is called continue-specific mode (CS). The desired mode for a session is designated when a communication macroinstruction is issued, but does not become effective until the operation is completed.

Although the CA-CS option code affects only RECEIVE operations, you can switch a session from one mode to the other by specifying the CA or CS option code in any OPNDST, OPNSEC, SEND, RECEIVE, or RESETSR macroinstruction for the session. The change from one mode to another is effective for the next communication operation on the session after this macroinstruction completes, not when the macroinstruction itself is executed. The session that is the object of the macroinstruction is the one whose CA-CS mode is changed. (For RECEIVE OPTCD=ANY, the session whose mode is changed is the one whose input is received by the RECEIVE operation.) If an error occurs and a macroinstruction that specifies a change in a session's CA-CS mode is not completed successfully (that is, (RTNCD,FDB2) does not equal (X'00',X'00'), (X'04',X'03') or (X'04',X'04')), the mode is not changed.

Continue-any and continue-specific modes can be set individually for the three types of input. For example, a session can be placed in a continue-specific mode for DFSYN RUs while it is in continue-any mode for DFASY and RESP RUs. The RTYPE operand on the macroinstruction specifies which type of input RU is to have its continue-mode changed. Any combination of input types, including NDFSYN, NDFASY, and NRESP (meaning no change is to be made), is valid.

Figure 1 illustrates how the various modes described in the preceding section relate to one another.

Figure 1. Example of using continue-any and continue-specific modes to handle concurrent inquiries
A diagram shows how to use continue-any and continue-specific modes to handle concurrent inquiries.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014