The EXIT Statement
Syntax
Format 1
EXIT
Format 2
EXIT PROGRAM
Description
The EXIT statement is used to exit routines or programs. Each of the two formats works slightly differently and is described in the correspondingly numbered area.
1. If the first format is used, it must be the only entry in a paragraph. The EXIT statement itself does nothing. The same effect can be accomplished by leaving the paragraph empty.
2. The second format is used to exit a subprogram. If the statement is executed from within a called program, control is returned to the calling program. If the statement is executed from within a main program, it has the same effect as the EXIT statement, that is, it does nothing.
Tips
1. Do not use the EXIT statement.
2. Use the EXIT PROGRAM statement only in a called subprogram.
3. If your system supports the GOBACK statement, use it in place of the EXIT PROGRAM statement in a called subprogram.
Posted by
KK
at
5:21 AM