COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-83
IF
•
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 9-26, 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.
IF
IF transfers control if the value of a condition is TRUE or FALSE.
Delimited-Scope Form
condition
is any conditional expression (see Conditional Expressions).
statement-1
is an imperative or conditional statement to be executed if the value of condition
is TRUE. It can contain other IF statements.
Example 9-26. Three-Way Conditional GO TO Statement
PROCEDURE-BRANCH.
GO TO PROC-X
PROC-Y
PROC-Z DEPENDING ON BRANCH-FLAG
MOVE 0 TO BRANCH-FLAG
Form Comment
Delimited-Scope Form
Recommended for clarity and convenience
Conditional Form
Form that was available in COBOL 74
ELSE statement-2
END-IF
IF
THEN
condition statement-1
VST160.vsd