Receiving requests from LUs
3 4
After the VTAM® application program establishes one or more sessions, the program can issue the RECEIVE macroinstruction to receive input on a session with an LU.
The RECEIVE and most other VTAM application program macroinstructions must furnish the address of a request parameter list (RPL), shown in the data declarations area of Figure 2. Fields in the RPL contain parameters that tell VTAM exactly how to perform the requested operation. On completion of a requested operation, VTAM places feedback information in the RPL, where it can be examined by the application program.
Each request that a VTAM application program sends or receives can contain data or control information or both. Data is information that is meaningful only to the processing portion of an application program. If a request contains data, the RECEIVE operation moves the data from VTAM to a designated area in the application program, for example to AREA1 shown in the data declarations area of Figure 2. The application program uses control information to direct the further exchange of requests and responses on the session. The application program puts control information into, or receives the control information from, the RPL that is specified on the SEND or RECEIVE macroinstruction.
A RECEIVE macroinstruction can be issued to receive input on a specific session, or on any session. To receive a request sent on any session, a RECEIVE OPTCD=ANY is issued, as shown at 3 in Figure 2. Such a RECEIVE is completed if VTAM is holding a request received on any session or is completed when such a request is received. (A facility exists to preclude selected sessions from completing such a RECEIVE.)
A RECEIVE macroinstruction can also be issued in such a way that only a request received on a specific session satisfies the RECEIVE. To do this, a program issues a RECEIVE OPTCD=SPEC with the RPL indicating the session from which the input is desired, as shown at 4 in Figure 2.
Completion of RECEIVE OPTCD=ANY might be followed by execution of a processing routine of the program and, subsequently, by having the processing part of the program call the communication part with individual requests for input and output. The communication part issues RECEIVE OPTCD=SPEC at 4 or it issues one or more SENDs at 5 or 6.
As implied by the preceding description, a RECEIVE is not completed until VTAM receives a request from an LU and passes it to the application program.