Job shldnt run when the source file is empty

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Mandar_Deshpande
Participant
Posts: 12
Joined: Wed Mar 02, 2005 1:59 am

Job shldnt run when the source file is empty

Post 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
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Perform a check of 'wc -l' via DataStage on the file before you trigger this file.
Mandar_Deshpande
Participant
Posts: 12
Joined: Wed Mar 02, 2005 1:59 am

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Mandar_Deshpande
Participant
Posts: 12
Joined: Wed Mar 02, 2005 1:59 am

Post by Mandar_Deshpande »

Hi All,
Thx very much for the i/ps i got the solution. :D
Post Reply