The BTEQ GOTO command is a branching command that can be used with the THEN clause of the IF...THEN... command to identify the destination of the branch operation. See I/O Errors and Abends.
Enter the GOTO command with a labelname parameter, which designates the skip destination. Identify the skip destination with a LABEL command. Note that only the first 30 characters of the labelname parameter are significant.
The GOTO command can be used only to skip forward in a script. Attempting to branch back to a statement listed before the GOTO command causes unexpected results. All subsequent lines in the script are skipped until the target LABEL command is found or BTEQ reaches the end of the script. Therefore, when using the GOTO command, the LABEL command that identifies the lablename must appear later in the script.