COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-81
GO TO
GO TO
Unconditional GO TO
Unconditional GO TO passes control to the beginning of a paragraph or section in the
current program.
procedure-name
is the name of the procedure (paragraph or section) to which the process transfers
control. If no procedure-name is present, the process must execute an ALTER
statement naming the procedure before it executes the GO TO statement to set the
destination procedure-name.
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 and Nondebugging Declarative Procedures
A GO TO statement in a debugging declarative procedure (a declarative procedure
introduced by a USE DEBUGGING statement) cannot refer to a nondebugging
declarative procedure. A GO TO statement in a nondebugging declarative
procedure cannot refer to a debugging declarative procedure.
•
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
.
Form Passes control to:
Unconditional GO TO
The beginning of a paragraph or section in the current program
Conditional GO TO
One of several procedures, depending on the value of a variable
data item
Note. The 1985 COBOL standard classifies ALTER as obsolete, so you are advised not
to use it, and therefore, not to use unconditional GO TO without procedure-name.
GO
procedure-nameTO
VST158.vsd