GOTO Command Process - Basic Teradata Query

Basic Teradata Query Reference

Product
Basic Teradata Query
Release Number
16.10
Published
May 2017
Language
English (United States)
Last Update
2018-06-28
dita:mapPath
wmy1488824663431.ditamap
dita:ditavalPath
Audience_PDF_include.ditaval
dita:id
B035-2414
lifecycle
previous
Product Category
Teradata Tools and Utilities

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.