Page 1 of 1

Job shldnt run when the source file is empty

Posted: Mon Jul 04, 2005 5:40 am
by Mandar_Deshpande
Hi All,
I have scenario here, the job shldnt get executed when the source file is empty or with 0 records in it How to achieve this in the job? do we have use any constaints at job level

Thanks
Mandar

Posted: Mon Jul 04, 2005 6:42 am
by Sainath.Srinivasan
Perform a check of 'wc -l' via DataStage on the file before you trigger this file.

Posted: Mon Jul 04, 2005 6:47 am
by Mandar_Deshpande
Hi sainath,

Thx for early reply
Can you be more clear on the solution i mean where should i check the "wc -l" ? my job flow is :
SeqFile--------->Transform--------------->HashFile

Posted: Mon Jul 04, 2005 6:50 am
by ArndW
Mandar,

you would need to write a sequence job, in that you call the UNIX command "wc -l {yourfilename}" to return you the number of lines, then you can conditionally call a job if this returned number is greater than zero.

Posted: Mon Jul 04, 2005 7:06 am
by Mandar_Deshpande
Hi All,
Thx very much for the i/ps i got the solution. :D