Introduction

Figure 1 shows a possible configuration with which sample program 2 might communicate.

The application program in the 3601 controller can be written to perform certain functions that would otherwise have to be performed by the VTAM® application program. For example, the 3601 application program can screen inquiries for the correct format prior to forwarding them to the VTAM application program for processing, or it can collect inquiries from several terminals that form a work station and send them as one transmission to the VTAM application program.

The logic of sample program 2 is described at a high level in Figure 1 and accompanying notes. The logic of special routines is described in more detail in subsequent figures and accompanying notes.

Figure 1. Possible data communication configuration for sample program
The diagram shows a possible data communication configuration with which sample program 2 might communicate.

Sample program 2 uses the posting of ECBs (either by VTAM or within the program) and a central wait routine that discovers posted ECBs as a mechanism to handle a number of sessions concurrently without having to suspend all program execution while waiting for an I/O operation to be completed. After a request has been issued for an asynchronous operation, control is transferred to the wait routine, which discovers (or, if necessary, waits for) a posted ECB. The posted ECB can be associated with another session and the wait routine branches to a point related to further processing for the session for which an operation has been completed. An understanding of the details of this technique is assumed in this discussion.

Although not discussed in detail, it is likely that sample program 2 would use a separate control block for each session that was established with the program. This control block can include an input/output area. A separate RPL can also be associated exclusively with each session. The storage for these control blocks can be obtained from a fixed pool or can be obtained dynamically and initialized with the GENCB macroinstruction. This control block and RPL area can be obtained and related to a session for the duration of that session, for the duration of the program, for the duration of a transaction, or on some other basis. The ECB associated with a session can be located in the RPL or outside of it in some fixed relationship, perhaps just in front of it. Organizing an application program, discusses some alternative approaches for control block storage management. In sample program 2, it is assumed that the storage for an ECB, RPL, and session-related control block is obtained and initialized in the LOGON exit routine and retained for the duration of the session with the program.