Previous Topic: Disallowed FunctionsNext Topic: Accessing Input Files with Multiple Record Layouts


Application Flow of Control

Flow of control in applications defined using the application compiler is, for the most part, similar for both batch and online applications.

The following special considerations apply to CA ADS Batch applications.

Selection of Responses

Application responses are selected on the basis of batch control events and input record response field values. In the online environment, responses are selected on the basis of a control key pressed or a response field value entered by the terminal operator.

As in the online environment, batch application responses invoke application functions; when a response is selected, so is the function it invokes.

Immediately Executable Functions

Application functions are, by default, immediately executable. Using the application compiler, you can specify, whether a function is immediately executable or deferred. The runtime system uses the specification on mapin operations to determine the next dialog response process or application function to be executed. If, on a mapin operation, both a response process and a function are valid selections, transfer of control depends on the specification for the selected function:

In the batch environment, all functions are, by default, immediately executable. You can override the default for a function by using the new Response Definition screen of the application compiler. The specification is made for the response that invokes the function.

Differences Between Batch and Online

This difference between batch and online flow of control stems from the difference in transaction processing. In the online environment, even if the terminal operator requests transfer to another function, data on the current screen may still require processing by the current dialog before control is passed to the next function. Therefore, the current dialog's response process takes precedence.

In the batch environment, if the current record's response field value selects a different function, it is assumed that that function is required to process the current input record. Thus, by default, control passes immediately to that function.

Immediately executable functions enable applications to access input files that have multiple record layouts, as described later in this chapter.

Mapin Operations

Mapin operations are performed by the appropriate functions. For input files that have response fields, the runtime system first examines the response field. If the response field keeps control within the current function, the runtime system maps the record into variable storage and executes a response process. If, instead, the response field selects another function, the runtime system delays the mapin and passes control to the selected function. The next time a mapin operation is performed for that file, the runtime system immediately maps in the record.

Delayed Mapin

The major points regarding delayed mapin are as follows:

Delayed mapin enables applications to access input files that have multiple record layouts, as described below.

For more information about flow of control, see Runtime Flow of Control.