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


Asynchronous requests

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

A VTAM® application program can also request that a communication operation be performed asynchronously with respect to the execution of the program. For example:
SEND  RPL=(2),AREA=AREA1,STYPE=REQ,RESPOND=(NEX,FME),         C
      OPTCD=ASY,POST=SCHED,ECB=ECB1
This SEND requests that VTAM schedule the sending of the data from AREA1 and immediately return control to the program. As soon as scheduling of the output has been completed, VTAM notifies the program either by posting an ECB (shown here) or by scheduling an RPL exit routine. (The relative advantages of posting ECBs and scheduling RPL exit routines are discussed in Organizing an application program, and in ECBs versus RPL exit routines.) The actual sending of a request can be requested to another type of asynchronous request. For example:
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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014