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


/* Continue Processing */

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

.LOGON phantom/test,test;
.SYSTEM 'test -s file';
.LOGOFF 123; -------------------> File 'abc' has size 0
.LOGOFF 234; -------------------> File 'abc' has size > 0


  <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: 28 Jun 2020