Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 03 Jul 2002 @ 13:00:45 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: How to use "Run file" command in Fast Export utility
 
From:   Sanjaya Nagabhushan

The "run file" command invokes the specified external file as the current source for FastExport utility commands and Teradata SQL statements effectively transferring processing control to an alternate run file.

After the FastExport utility executes the run file command, it reads additional commands from the specified source until a LOGOFF command or end-of-file condition is encountered, whichever occurs first. An EOF condition automatically causes the FastExport utility to resume reading its commands and DML statements from the previously active source.

Syntax ...

.RUN FILE IGNORE THRU ;

where "file" is the data source which specifies a file. On Unix & Windows it is the pathname for a file

"charpos1" through "charpos2" specifies the character positions of a field in each input record that contains extraneous information.

If we specify ...

1) charpos1 - Only the single character at the specified position is ignored

2) charpos1 THRU - All characters from charpos1 through the end of the record are ignored

3) THRU charpos2 - All characters from the beginning of the record through charpos2 are ignored

4) charpos1 THRU charpos2 - All characters from charpos1 through charpos2 are ignored

The source specified by a RUN FILE command can have up to 16 levels of nested RUN commands.

RUN FILE command could also be used on the command line as ...

$>fexp -r '.run file rf;'

where "rf" is the FastExport Job Script.

Illustration of using "run file" on the command line :

rf is the FastExport Job Script ...

.logtable logert;
.logon machine1/dr,dr;
sel * from temp;
.export outfile job.out mode record;
.end export;
.logoff;

Here "temp" is a table under the user "dr" whose contents are 3 strings viz.

abc ,def & ghi.

Invoking the command

fexp -r '.run file rf;'

results in exporting the 3 rows of "temp" to the file "job.out"

Alternately you could invoke FastExport & then invoke

.run file rf;

to get a similar output.

Illustration of using "run file" in the FastExport Job Script :

rf1 is the FastExport Job Script ...

.logtable logert;
.logon pearl/dr,dr;
.begin export sessions 4;
.run file qry;
.export outfile job.out mode record;
.end export;
.logoff;

qry is the file containing the query ...

sel * from temp;

Invoke the command

fexp < rf1

or alternately invoke FastExport first & then invoke

.run file rf1;

for the same effect. The latter method also illustrates the nesting of "run file" command (The file "rf1" has another "run file" command).

For detailed information about FastExport & its commands, you could download the FastExport manual from www.info.ncr.com -> Teradata Data Warehousing -> Teradata Client - FastExport


Regards,

Sanjay



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023