GOBACK Statement - COBOL

The GOBACK statement specifies the logical end of a called program.


The GOBACK statement is equivalent to the sequence:


The GOBACK statement must appear as the only statement, or as the last of a series of imperative statements, in a sentence.

The GOBACK statement must not appear in a declarative procedure in which the GLOBAL phrase is specified.

If control reaches a GOBACK statement while operating under the control of a CALL statement, control returns to the point in the calling program immediately following the CALL statement.For details, see the discussion of the EXIT PROGRAM statement.

If no CALL statement is active and the GOBACK statement is executed in the main program, control returns to the invoker (which may be the operating system and thus cause the end of the run unit).

GOBACK Statement Examples

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics