Abort the job when source file is empty in FTP

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
srividhya
Participant
Posts: 42
Joined: Tue May 31, 2005 10:11 am

Abort the job when source file is empty in FTP

Post by srividhya »

Hai
Iam using FTP stage to read the source file. I have to abort the job if the source file is empty. If the iam reading from the sequential file then i can use wc -file name then trigger my job. But using FTP plugin stage I have no clue how to handle this.
I can do the rowcount after the job and abort the job, but is there any other way to do this

Thanks
Srividhya
vcannadevula
Charter Member
Charter Member
Posts: 143
Joined: Thu Nov 04, 2004 6:53 am

Re: Abort the job when source file is empty in FTP

Post by vcannadevula »

srividhya wrote:Hai
Iam using FTP stage to read the source file. I have to abort the job if the source file is empty. If the iam reading from the sequential file then i can use wc -file name then trigger my job. But using FTP plugin stage I have no clue how to handle this.
I can do the rowcount after the job and abort the job, but is there any other way to do this

Thanks
Srividhya
First FTP the file. IN the second job execute the Unix command to check the size and if it is zero then abort the job and do the cleanup of the ftped file
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Never abort.

Retain control.

In a job sequence perform the FTP. Then test the size of the result. If this is non-zero, then proceed with the job that processes it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
srividhya
Participant
Posts: 42
Joined: Tue May 31, 2005 10:11 am

Post by srividhya »

Hai Ray,
I never abort my job, if any of my check failures iam inserting a row in the reject table with the reason for that rejection.
But I dont know how to do the check in this case

Thanks
Srividhya
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use the UNIX command test (with -z option) in an Execute Command activity, or use OpenSeq, FileInfo() and CloseSeq in a Routine activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
srividhya
Participant
Posts: 42
Joined: Tue May 31, 2005 10:11 am

Post by srividhya »

Thanks Ray,

Iam using Test -s , option -z is to check a string not a file. Am i doing correct .......

Thanks
Srividhya
Post Reply