Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 25 Jul 2002 @ 04:24:36 GMT


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


Subj:   Re: FastExport return code
 
From:   Sanjaya Nagabhushan

You could check if the file created is empty & based on that, return a code of your choice as illustrated below

1) Use the ".SYSTEM" command to check if the created file is empty

.SYSTEM 'test -s file.name'

The specified command 'test -s file.name' (On a unix box) is executed & the return value is available in &SYSRC. Your only concern here is whether &SYSRC is ZERO (File is non-empty) or NON-ZERO (File is empty).

2) If the return value is non-zero, it means that the file is empty, hence return an appropriate return code using the ".LOGOFF" command

.IF &SYSRC <> 0 THEN;
.LOGOFF ;
.ELSE;

/* Continue Processing */

Here is the complete script to just check the size of a file

.LOGTABLE abc;
.LOGON phantom/test,test;
.SYSTEM 'test -s file';
.IF &SYSRC <> 0 THEN;
.LOGOFF 123; -------------------> File 'abc' has size 0
.ELSE;
.LOGOFF 234; -------------------> File 'abc' has size > 0

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: 27 Dec 2016