HP 3000 Manuals

EXIT PROGRAM Statement [ HP COBOL II/XL Reference Manual ] MPE/iX 5.0 Documentation


HP COBOL II/XL Reference Manual

EXIT PROGRAM Statement 

The EXIT PROGRAM statement marks the logical end of a program.

Syntax 

     EXIT PROGRAM 

Description 

If you use an EXIT PROGRAM statement in a program (called or otherwise),
it must appear as the only statement in a sentence, and the sentence must
be the only sentence in a paragraph.  Also, EXIT PROGRAM must not appear
in a declarative procedure that has a  GLOBAL phrase.

When encountered in a called program, the EXIT PROGRAM statement causes
control to return to the statement of the calling program immediately
following the CALL statement used to pass control to the called program.

If the EXIT PROGRAM statement is used in a main program, it is treated as
an EXIT statement.  Thus, in a main program, it serves only as a way of
terminating a procedure. 



MPE/iX 5.0 Documentation