Procedure Body Execution

Initialisation

Display

Run Another Program

If the procedure body is of type Run another program, the command line is executed. If the procedure body is type Link to C, the C exit is called.

Field Processing

If the procedure is a menu or an action bar, an option is selected unless force option is set or the user pressed a short cut function key in an earlier procedure. If the user presses <Escape>, the Escape option is selected if there is one, otherwise the procedure is terminated returning ESCAPE.

The fields are processed in turn, as described under Processing for Each Field . All database accesses and any other questions and remarks in the procedure are associated with one of the fields (for instance, if deletion is enabled the question offering to delete the record is associated with the field at which the main record became defined).

The processing sequence may be modified by user input, as described below.

User Input

The user may press one of the keys which move to another field. When this happens, the following takes place:

If confirm updates was selected, after the last field has been processed the user will be offered the Save/rekey/abandon menu. If rekey is chosen, processing is returned to the point after the main record is defined.

Posting/Deleting and Final Processing

If field processing is terminated normally:

Otherwise if deletion is to take place:

If the program does not use the private database and the number of times an updating procedure body has been executed is greater than or equal to the commit_frequency, the updates are confirmed with commit(). If this fails and terminate on commit failure was specified in the program header, the program terminates. Otherwise, an error message indicating the reason for failure is produced unless the program header suppressed update fail messages.

If updates fail, execution of the procedure body returns TERMINATED.

Print output is flushed and the screen is cleared as appropriate.