COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-82
Conditional GO TO
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.
GO
DEPENDING ON
depend
procedure-name
TO
VST159.vsd