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


How an asynchronous operation works

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

In an asynchronous operation, VTAM® returns control to the next sequential instruction as soon as it has accepted the request, not when the requested operation has been completed. Accepting a request consists of screening the request for errors and scheduling the parts of VTAM that eventually carry out the operation. While the operation is being performed, the application program is free to initiate other data-transfer operations or do other processing. For example, an application program can issue a RECEIVE macroinstruction and indicate that the operation is to be handled asynchronously (OPTCD=ASY). While the input operation is being performed, the application program can begin to write to a direct-access storage device or receive input on another session.

When an asynchronous operation is specified, there are two ways that VTAM can notify the application program that the requested operation has been completed. If the application program associates an event control block (ECB) with the request, VTAM posts the ECB when the operation is completed. Alternatively, the application program can designate that a particular RPL exit routine is to be executed as soon as the operation is completed. When the operation is completed, VTAM schedules the exit routine. The method of notification is controlled by the setting of the ECB operand or EXIT operand in the RPL used for the request. Figure 1 illustrates asynchronous processing in an application program using ECBs; Figure 1 illustrates the use of an RPL exit routine.

Regardless of whether an application program waits on an ECB or uses an RPL exit routine, a CHECK macroinstruction must be issued after an asynchronous operation to mark the RPL inactive and to make it available for another operation. The CHECK macroinstruction also clears the ECB. Prior to CHECK, the RPL active flag is still on. The RPL and associated data areas (for example, NIB, RPLAREA, and ECB) cannot be freed, altered, or reused.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014