You can also alter the normal execution sequence by branching. A branch transfers control from one statement to a labeled branch target statement in the same scoping unit. A branch target statement can be any executable statement except a CASE, ELSE, or ELSE IF statement.
The following statements can be used for branching:
transfers program control to an executable statement, whose statement label is designated in an ASSIGN statement. See GO TO (Assigned) for syntax details.
transfers control to possibly one of several executable statements. See GO TO (Computed) for syntax details.
transfers control to a specified executable statement. See GO TO (Unconditional) for syntax details.
transfers control to one of three executable statements, depending on the evaluation of an arithmetic expression. See IF (Arithmetic) for syntax details.
The following input/output specifiers can also be used for branching:
transfers control to a specified executable statement if an endfile record is encountered (and no error occurs) in a READ statement.
transfers control to a specified executable statement in the case of an error. You can specify this specifier in the BACKSPACE, ENDFILE, REWIND, CLOSE, OPEN, READ, WRITE, and INQUIRE statements.
transfers control to a specified executable statement if an end-of-record condition is encountered (and no error occurs) in a READ statement.