Previous Topic: GET CommandNext Topic: INCREMENT Command


GOTO Command

(Area 3)

The GOTO (or GO TO) command causes conditional or unconditional transfer to another statement within the Reporting Facility program. The format of the GOTO command is as follows:

►►─┬──────────┬─ GOTO ─ destination ─┬──────────────────────┬─────────────────►◄
   └─ label: ─┘                      └─ logical expression ─┘
label:

Specifies an optional identifying label, possibly referenced within another GOTO command, that allows a GOTO branch to be made to this statement.

destination

The destination can be any of the following:

label

Specifies the label attached on the statement to which control is to be passed.

START

Specifies that control is to be passed to the predefined label START. Control is passed to the first procedural instruction.

TEST

Specifies that control is to be passed to the predefined label TEST. All further data manipulation statements are bypassed and control is passed directly to the record selection logic corresponding to the first SELECT statement.

EOJ

Specifies that control is to be passed to the predefined label EOJ. In Primary mode, file reading stops, the sort begins, and reports print (containing only records selected up to that point). In Secondary or Write-Only mode, files close and the Reporting Facility run terminates.

ABORT

Indicates that an abnormal condition exists. The system terminates processing with a complete formatted dump.

logical expression

Specifies the constraints for any branching. If omitted, the Reporting Facility takes an unconditional branch to the specified label. When coded, the logical expression must be satisfied before any branching takes place. The branch is to either the specified label or the next sequential instruction.

You can apply and branch labels only to these commands:

ADD
COMPUTE
CONTINUE
DECODE

DECREMENT
DIVIDE
ENDPROC
GET

GOTO
INCREMENT
MOVE
MULTIPLY

PERFORM
PROC
SET
SUBTRACT