ILE COBOL Programmer's Guide


Ending an ILE COBOL Program

An ILE COBOL program can be ended by the following:

A STOP RUN statement is implied when a main ILE COBOL program has no next executable statement (implicit EXIT PROGRAM for a ILE COBOL subprogram), that is, when processing falls through the last statement of a program.

Inquiry messages can be issued in response to a ILE COBOL statement (namely a STOP literal), but they are usually issued when a severe error occurs in a program, or when a ILE COBOL operation does not complete successfully. (Examples are LNR7205, LNR7207, and LNR7208.) Inquiry messages allow you to determine what action to take after an exception error has occurred.

There are four common replies to a COBOL inquiry message: C, D, F, and G (cancel, cancel and dump, cancel and full dump, continue). The first three cause (as their final steps) an implicit abnormal STOP RUN.

An implicit or explicit STOP RUN statement, or a GOBACK statement in the main ILE COBOL program, causes the termination-imminent condition to be signalled to the nearest control boundary. The termination-imminent condition can be handled in two ways:

If this control boundary is a hard control boundary, then the activation group (run unit) will end.

If the STOP RUN is abnormal and a hard control boundary is reached, the CEE9901 escape message is issued to the program before the control boundary.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]