wait-for-file

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
Durga
Participant
Posts: 31
Joined: Mon Apr 16, 2007 12:04 pm

wait-for-file

Post by Durga »

Hi,


my requirment is like this

my source file comes anytime between 11:00 a.m and 4 p.m

I need to process that file as soon as it lands in the unix directory.

I need to check for the file for every half an hour from 11:00 am to 4:pm

in my job sequence i have waitforfile and jobactivity stage which calls actual job

in waitforfile stage I set the timeout length to 1/2 hour.
here my question is , it waits for 1/2 hour, if file is not there yet,the job aborts.
how to be in loop till 4:00 pm.can you please let me know how to acheive this

Thanks
Durga
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not just set the timeout to 5 hours and be done with it? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

Use Start loop and End loop stages in your job sequence and set loop for 10 times i.e from 1 to 10.... and wait stage for 30 minuters...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: wait-for-file

Post by chulett »

Durga wrote:I need to process that file as soon as it lands in the unix directory.

I need to check for the file for every half an hour from 11:00 am to 4:pm
These two statements are mutually exclusive.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

trammohan wrote:Use Start loop and End loop stages in your job sequence and set loop for 10 times i.e from 1 to 10.... and wait stage for 30 minuters...
Curious how this is any different from simply setting the timeout to 5 hours and waiting once? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Durga
Participant
Posts: 31
Joined: Mon Apr 16, 2007 12:04 pm

Post by Durga »

Yes Craig, you are right.

as soon as file arrives, I need to process and come out of the loop.I don't need to loop through 4'o clock, if file comes before that.

Thanks
Durga
Participant
Posts: 31
Joined: Mon Apr 16, 2007 12:04 pm

Post by Durga »

thanks rammohan for your suggestion.I will try it and see
trammohan
Participant
Posts: 47
Joined: Thu Nov 13, 2003 12:47 pm

Post by trammohan »

chulett wrote:
trammohan wrote:Use Start loop and End loop stages in your job sequence and set loop for 10 times i.e from 1 to 10.... and wait stage for 30 minuters...
Curious how this is any different from simply setting the timeout to 5 hours and waiting once? :?

Input file may appear any time between 0 to 5 hrs.... Let us say if it appears in 30 minutes.. it executes the sequence and exit the process...no need to wait for the remaining time..........
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's the thing - the loop is superfluous and totally unneeded here. The timeout value is the longest it will wait for the file to show up, the moment it does show up it will cease to wait and pass on control to the next stage. There is no 'waiting for the remaining time'. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Durga
Participant
Posts: 31
Joined: Mon Apr 16, 2007 12:04 pm

Post by Durga »

Thanks Craig and Rammohan for clarification
Post Reply