All Forums Tools
07 Aug 2014
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

feinholz 1234 posts Joined 05/08
07 Aug 2014

What would you like the IF ELSE condition to accomplish?

--SteveF

08 Aug 2014

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.

feinholz 1234 posts Joined 05/08
08 Aug 2014

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

--SteveF

feinholz 1234 posts Joined 05/08
08 Aug 2014

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

Raja_KT 1246 posts Joined 07/09
09 Aug 2014

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?

Raja K Thaw
My wiki: http://en.wikipedia.org/wiki/User:Kt_raj1
Street Children suffer not by their fault. We can help them if we want.

12 Aug 2014

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.

27 Aug 2014

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

You must sign in to leave a comment.