Synchronous requests
SEND RPL=(2),STYPE=REQ,AREA=AREA1,RESPOND=(NEX,FME), C
OPTCD=SYN,POST=SCHEDThis SEND specifies that a request (STYPE=REQ) be sent from AREA1 and that a definite response be returned whether or not the request arrives and is processed successfully (RESPOND=(NEX,FME)). Execution of the VTAM application program (or at least execution of the task or SRB from which the macroinstruction is issued) is suspended because the application program has specified OPTCD=SYN, and the next instruction is not executed until VTAM has determined that the requested operation has been performed. In this case, however, the requested operation is the scheduling of a SEND (POST=SCHED) rather than the actual transmission. Certain circumstances can delay the actual scheduling. For example, the scheduling can be delayed until the LU has returned a session-level pacing response indicating that it is ready to receive the next request on the session. Another example is scheduling being delayed while waiting for a virtual-route-pacing response for the route associated with the session. The ASY option is preferable because it will not cause the application program to be delayed.
SEND RPL=(2),STYPE=REQ,AREA=AREA1,RESPOND=(NEX,FME), C
OPTCD=SYN,POST=RESPFor this SEND, the VTAM application program has to wait until VTAM receives a response to the request (POST=RESP). A program that communicates on a few sessions and waits for each communication request to be completed before doing any further processing might use this kind of synchronous operation; for most programs, however, this is not efficient.
POST=RESP cannot be specified unless a definite response is requested; that is, no-response or exception-response-only cannot be specified with POST=RESP, because VTAM would never know that the request had arrived at the LU.
RECEIVE RPL=(2),RTYPE=DFSYN,AREA=AREA1,AREALEN=100, C
OPTCD=(SYN,SPEC)Here, execution of the VTAM application program is suspended until input arrives on the session (whose CID is located in the RPLARG field). This is efficient only in simple programs where batch input is being received, or in programs where a request is known to be in VTAM buffers. If a request received in VTAM's buffers is larger than the amount of data read each time a RECEIVE is issued, the KEEP option (described in Handling overlength input data) is used.
RECEIVE RPL=(2),RTYPE=DFSYN,AREA=AREA1,AREALEN=200, C
OPTCD=(SYN,ANY)Here, execution of the VTAM application program is suspended until input arrives on any session that is not in the CS mode. This type of request is most likely to be used in a program that communicates on a few sessions. It can also be used with a large number of sessions if response time is not important.