Example 2: IF, ELSE, and ENDIF - Parallel Data Pump

Teradata® Parallel Data Pump Reference - 17.20

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Parallel Data Pump
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-11-17
dita:mapPath
kpf1641281806652.ditamap
dita:ditavalPath
ovd1619195504008.ditaval
dita:id
ouq1478611619316
Product Category
Teradata Tools and Utilities

In Example 2, 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. 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.

0010 .SET CREATERC TO &SYSRC;
0011 .IF &CREATERC = 3803 /* Table &TABLE already exists */ THEN;
UTY2402 Previous statement modified to:
0012 .LOGOFF 08;
0013 .RUN FILE RUN01;
0014 .ELSE
0015 .IF &CREATERC <> 0 THEN
0016 .LOGOFF &CREATRC;
0017 .ENDIF