FTP only when file exists

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
slavik0329
Participant
Posts: 11
Joined: Tue Jan 10, 2006 2:33 pm

FTP only when file exists

Post by slavik0329 »

Hey,

I have an FTP job that I want only to run when a certain file exists. I don't want the job to fail if it doesn't.
mujeebur
Participant
Posts: 46
Joined: Sun Mar 06, 2005 3:02 pm
Location: Philly,USA

Re: FTP only when file exists

Post by mujeebur »

Write a shell script with the logic of ftp and not fail if no file exists and call that in Job Control of DataStage Job.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi Slavik,

You can also use the 'Wait-for-file Activity' stage in your job sequence to wait for your file to appear. Now, once the file appears, you can next trigger a job activity which calls the FTP job.


Another approach would be to handle this at scheduling level. Scheduling tools such as ^M have the ability to wait for a file and then trigger the next process.

ANything that suits your needs, :wink:

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
tostay2003
Participant
Posts: 97
Joined: Tue Feb 21, 2006 6:45 am

Post by tostay2003 »

One doubt regarding this. Can we do it this way as well?

a) Open the job where u r reading from ftp
b) click job properties
c) Select DSWaitForFile in Before subroutine.
d) specify the server path

Note : I have not used ftp, so far, but guess the above procedure works same way as for sequential files.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi tostay,

thats sounds good too. It should work.

Thanks,
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Post Reply