Page 1 of 1

wait-for-file

Posted: Thu Mar 27, 2008 12:32 pm
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

Posted: Thu Mar 27, 2008 12:40 pm
by chulett
Why not just set the timeout to 5 hours and be done with it? :?

Posted: Thu Mar 27, 2008 12:43 pm
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...

Re: wait-for-file

Posted: Thu Mar 27, 2008 12:47 pm
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.

Posted: Thu Mar 27, 2008 12:50 pm
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? :?

Posted: Thu Mar 27, 2008 12:52 pm
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

Posted: Thu Mar 27, 2008 12:53 pm
by Durga
thanks rammohan for your suggestion.I will try it and see

Posted: Thu Mar 27, 2008 12:54 pm
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..........

Posted: Thu Mar 27, 2008 12:58 pm
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'. :?

Posted: Thu Mar 27, 2008 1:14 pm
by Durga
Thanks Craig and Rammohan for clarification