Example 2: IF, ELSE, and ENDIF - FastExport

Teradata® FastExport Reference

Product
FastExport
Release Number
17.00
Published
September 30, 2020
Language
English (United States)
Last Update
2020-09-02
dita:mapPath
ups1544831946863.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
B035-2410
lifecycle
previous
Product Category
Teradata Tools and Utilities

In the following example, the user has created the table named &TABLE and a variable named CREATERC, into which is set the system return code resulting from the execution of the CREATE TABLE statement: .SET CREATERC TO &SYSRC;

.SET CREATERC TO &SYSRC;
.IF &CREATERC = 3803 /* Table &TABLE exists */ THEN;
.RUN FILE RUN01;
.ELSE;
.IF &CREATERC <> 0 THEN;
.LOGOFF &CREATRC;
.ENDIF;
.ENDIF:

If the table name has not already been used, and the return code is not zero, the return code evaluates to an error condition and the job logs off with the error code displayed.