(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 ─┘
Specifies an optional identifying label, possibly referenced within another GOTO command, that allows a GOTO branch to be made to this statement.
The destination can be any of the following:
Specifies the label attached on the statement to which control is to be passed.
Specifies that control is to be passed to the predefined label START. Control is passed to the first procedural instruction.
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.
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.
Indicates that an abnormal condition exists. The system terminates processing with a complete formatted dump.
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 |
DECREMENT |
GOTO |
PERFORM |
|
Copyright © 2014 CA.
All rights reserved.
|
|