Asynchronous requests
SEND RPL=(2),AREA=AREA1,STYPE=REQ,RESPOND=(NEX,FME), C
OPTCD=ASY,POST=SCHED,ECB=ECB1
SEND RPL=(2),AREA=AREA1,STYPE=REQ,RESPOND=(NEX,FME), C
OPTCD=ASY,POST=RESP,EXIT=RPLEXIT
This SEND specifies that VTAM begin sending the request at AREA1 and immediately return control to the program. When VTAM receives a response indicating the success or failure of the transmission and processing, VTAM schedules an RPL exit routine at RPLEXIT. The program continues processing; the RPLEXIT exit routine automatically gets control when this operation is completed. Or, if ECB-posting is specified instead of the exit routine, the program continues processing (minus the time VTAM takes to get control and post the ECB) until it discovers the ECB is posted or until the program issues a WAIT or a CHECK macroinstruction.
While synchronous operations are easier to program, they are inefficient with regard to the amount of processing that the program can do. Asynchronous operations are more difficult to program, but are required to handle communication with a reasonably large number of sessions.