COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

ALTER Statement
Because the 1985 COBOL standard classifies ALTER as an obsolete element, and because
the ALTER statement can cause maintenance problems, so you are advised not to use it. For
more information, see ALTER.
Consecutive Imperative Statements in a Sentence
When a GO TO statement includes procedure-name and the paragraph containing the
GO TO statement is not referenced by an ALTER statement, the GO TO statement can be the
last of a sequence of consecutive imperative statements within a sentence.
Conditional GO TO
Conditional GO TO passes control to one of several procedures, depending on the value of a
variable data item.
procedure-name
is the name of the procedure (paragraph or section) to which the process transfers control,
depending on the value of depend. The GO TO statement can have as many as 255 different
procedure names.
depend
is the identifier of an elementary integer data item. Its value determines which procedure will
receive control. If the value of depend is less than 1 or exceeds the number of procedures,
control passes to the next statement.
Usage Considerations:
Declarative and Nondeclarative Procedures
A GO TO statement in a declarative procedure (a procedure in the Declaratives Portion of
the Procedure Division) cannot refer to a nondeclarative procedure (a procedure in the other
portion of the Procedure Division). A GO TO statement in a nondeclarative procedure cannot
refer to a declarative procedure.
Debugging Declarative Procedures
A GO TO statement in a debugging declarative procedure cannot refer to a nondebugging
declarative procedure. A GO TO statement in a nondebugging declarative procedure cannot
refer to a debugging declarative procedure.
In Example 95, if BRANCH-FLAG equals 1, control passes to PROC-X. If BRANCH-FLAG equals
2, control passes to PROC-Y. If BRANCH-FLAG equals 3, control passes to PROC-Z. If
BRANCH-FLAG is less than 1 or greater than 3, control passes to the MOVE statement
immediately following the GO TO statement.
GO TO 335