Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

GOTO Branch to tag

&pagelevel(4)&pagelevel

Domain: PROCEDURE

Command description

GOTO branches to the specified tag and continues procedure execution from that location. The tag must be defined in the same or a surrounding block (see Example 2). In addition, the tag must be unique to the procedure. (See also the section “Random branch destinations” for more on GOTO)

Note
Expression replacement (&...) is not permissible for this command.

Format

GOTO

LABEL = <structured-name 1..255>

Operands

LABEL = <structured-name 1..255>

Name of the tag where procedure execution is to resume; the name is specified without the terminating colon.

Command return codes

(SC2)

SC1

Maincode

Meaning


0CMD0001No error

1CMD0202Syntax error

1SDP0118Command in false context

1SDP0139Back branch limit reached

1SDP0223Incorrect environment

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

130SDP0099No further address space available

Example 1

.
.
.
/GOTO TAG10
.
.
.
/TAG10: CREATE-FILE ...

Example 2

/LOOP1: WHILE (A < B)
/ADD1:      X = X + A
/LOOP2:     WHILE (X < Y)
/ADD2:          A = A + 1
/               GOTO ADD1                "Permitted, because outer loop"
/           END-WHILE LOOP2
/           GOTO ADD2                    "Forbidden, because inner loop"
/       END-WHILE LOOP1