ContentsIndexPreviousNext

GO TO Statement

The GO TO statement provides for a direct transfer of control in the Procedure Division.

General Format

Format 1

GO TO procedure-name

Format 2

GO TO {procedure-name} ... DEPENDING ON depend-item

Syntax Rules

1. Procedure-name is the name of a paragraph or section in the program.

2. Depend-item is an integer elementary numeric data item.

3. A Format 1 GO TO that is in a consecutive sequence of imperative statements in a sentence must be the last statement in that sentence.

General Rules

Format 1

1. The GO TO statement transfers control to procedure-name. No return mechanism is implied.

Format 2

2. The GO TO DEPENDING statement transfers control to one of the procedure-names depending on the value of depend-item. A depend-item value of "1" refers to the first procedure-name, a value of "2" refers to the second, and so on.

3. If depend-item is less than or equal to zero, or is greater than the number of procedure-names, no control transfer occurs. In this case, the GO TO statement has no effect.