Previous Topic: OverviewNext Topic: Specifying File Characteristics


Runtime Flow of Control

Flow of control at runtime determines which dialog in an application is executed and, within a dialog, which premap or response process is executed and whether a mapin or mapout operation is performed. Most batch flow of control considerations are similar to those for online applications.

An overview of batch runtime flow of control is provided under "Batch Dialog Structure" and "Application Structure" in CA ADS Batch Concepts. A detailed description of the flow of control on a mapin operation is provided below.

The diagram below shows the flow of control on a mapin operation for an application not defined using the application compiler.

Notes:

1 A response process is selected by the occurrence of a batch control event (BCE) or response field value (RFV). If the BCE or RFV do not invoke a response process and if a physical input error did not occur, the dialog's default response process, if any, is selected.

2 The response process is not executed if the record contains input errors and EXECUTE ON EDIT ERROS is NO for the response process. Instead, the record is written to the suspense file, error messages are sent to the log file, and another record is read and mapped in.

3 The application aborts if the same dialog encounters an end-of-line condition for a second time.

The following two diagrams show the runtime flow of control on a mapin operation for an application that is defined using the application compiler, as follows:

Notes:

1 A function is selected by the occurrence of a batch control event (BCE) or a response field value (RFV). If the BCE or RFV is associated with an application response that is valid for the current function, then the function invoked by the response is selected. The function invoked by the current function's default response is selected if no valid function is selected, if a physical input error did not occur, and if the RFV is spaces (or the map has no response field or an end-of-file condition has occurred).

2 By default, all functions in the batch environment are immediately executable.

3 A response process is selected by the occurrence of a BCE or RFV. If the BCE and RFV do not invoke a response process, and if a physical input error did not occur, the dialog's default response process, if any, is selected.

4 The response process is not executed if the record contains input errors and EXECUTE ON EDIT ERRORS is NO for the response process. Instead, the record is written to the suspense file, error messages sent to the log file, and another record is examined and/or mapped in.

5 If a deferred function was also selected, it can be executed by an EXECUTE NEXT FUNCTION command.

6 In this case, the selected function may be the same as the current function. If so, the associated dialog is reexecuted, beginning with its premap process or mapin operation, as applicable.

7 The application abends if the same dialog encounters an end-of-file condition for a second time.

Runtime Flow of Control

The runtime flow of control is as follows:

  1. A dialog performs a mapin operation that examines the response field value of the next input record. The record's response field value invokes an immediately executable function that is not the same as the current function. Control passes to that function, which executes its associated dialog. The record has not yet been mapped into variable storage.
  2. The second dialog performs a mapin operation on the same file. The record is immediately mapped into variable storage.
  3. The response field value for the record mapped in is associated with an immediately executable function; this time, however, the function is the same as the current function, so the function is not reexecuted.
  4. The runtime system selects and executes a response process. (If no response process can be selected, the current function is re-executed from the beginning of the dialog).