FASTEXPORT Looping

Tools
Enthusiast

FASTEXPORT Looping

Hi All,

Can somebody write a simple FastExport script with IF ELSE condition. THe example given in info.teradata.com. I am not able to understand it.

THanks in Advance

Jugal

7 REPLIES
Teradata Employee

Re: FASTEXPORT Looping

What would you like the IF ELSE condition to accomplish?

-- SteveF
Enthusiast

Re: FASTEXPORT Looping

Hi Steve,

I tried a simple running a simple script using BTEQ using Looping Condtion.

Script:

.Logon username/pwd,

.IF 'TRUE'='TRUE' THEN;

.RUN FILE FastExport.txt;

.ENDIF;

.LOGOFF;

bteq < script

I got a error relating to the FastExport LogFile. I tried this script refering to Page No.115(IF ELSE AND ENDIF). I don see a detailed information on how the Looping is done. Being a Learner, i understand this is how the script is runs for looping. ANd ALso in MLOAD a similar script to above is return to restart the LogTable.

Teradata Employee

Re: FASTEXPORT Looping

It would help to know the contents of the FastExport.txt script.

-- SteveF
Teradata Employee

Re: FASTEXPORT Looping

If the "FastExport.txt" file contains FastExport commands, then this cannot be run through BTEQ.

A file that is used in the RUN FILE command in a BTEQ script, must contain only BTEQ commands.

If you want to run a FastExport job, then you need to invoke the FastExport utility from the command line.

-- SteveF
Enthusiast

Re: FASTEXPORT Looping

IF ELSE is conditional statement. You read the line thus:

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:

Looping is achieved by using for, while, do while or calling a program recursively. Maybe you can think of calling a fastexport script applying conditions from a unix script or you can put in a loop according to your requirement?

Enthusiast

Re: FASTEXPORT Looping

Hi Raja,

Your right. It is a conditional statement, i was wrong to call it looping. What i dont understand in the example or i don see a section which explains the way, conditional statement can be applied in FAST EXPORT. I request u to post a small example scripts which explains how the COndtional statement is applied.

Enthusiast

Re: FASTEXPORT Looping

Hello All,

After lot of R&D i understood how the IF ELSE statement can be applied.

.LOGTABLE LOG;

.BEGIN EXPORT;

.EXPORT OUTFILE exported;

SEL * FROM TABLENAME;

.END EXPORT;

.IF 1=1 THEN;

.DISPLAY 'SUCCESS' TO FILE pathname;

.ENDIF;

.LOGOFF;

Hope it helps learners like me to understand the how to apply IF ELSE statement.

Thanks

Jugal