Using RPL exit routines
Instead of having VTAM® post an ECB when a request for an asynchronous operation is completed, the application program might have VTAM schedule and cause control to be given to an RPL-specified asynchronous exit routine. The RPL exit routine can supply the logic that would have been branched to by the mainline program after discovering a posted ECB. An RPL exit routine is any exit routine whose symbolic name has been provided in the EXIT operand of the macroinstruction or in the RPL used for the request.

One advantage to using an RPL exit routine instead of an ECB is that it is easier to code for that type of processing than it is to code the logic associated with discovering a posted ECB and relating the ECB to a branch address. Also, the RPL exit routine is given control almost immediately after the associated RPL-based operation completes, and thus has priority over the mainline program. A disadvantage of an RPL exit routine is that more system instructions must be executed to schedule an exit routine than must be executed to post an ECB. Also, as discussed in the previous section, RPL-exit scheduling does not provide as much flexibility as ECB-posting for giving a higher priority to selected operations. An application program can use a combination of ECB-posting and RPL exit routines. See Logic of a more complicated application program, for more information on the general logic of a multithread program.
An RPL exit routine can itself issue asynchronous requests, continue executing, and return to VTAM. The asynchronous request in an RPL exit routine can specify that, upon completion of the request, an ECB is to be posted or an RPL exit routine is to be scheduled. If the RPL exit routine option is chosen, the exit routine might be the same one in which the request was issued. (This is also shown in Sample Program 2 in Logic of a more complicated application program.) Figure 2 shows a possible pattern of asynchronous requests within RPL exit routines. Further information about RPL exit routine operation is given in Normal operating system environment for a VTAM application program and in RPL exit routines.
