Page 1 of 1

Wait for directory to have file(s)

Posted: Mon Feb 27, 2006 1:47 pm
by Nsg
I have a sequencer where the starting point is wait for file activity ,,, i have specified a path name and file name and only when that file appears the job runs...

but if the need is to start the job whenever file(s) land(appear) in a particular directory trigger the job ,,, can this be done ,,, going through the documentation i didnot find any such clause/condition

can you please help me find an answer to this

Thanks

Posted: Mon Feb 27, 2006 1:53 pm
by kumar_s
Try /path_name/* under filename optoin.

Posted: Mon Feb 27, 2006 1:58 pm
by I_Server_Whale
Hi Nsg,

You can also use mutliple Wait-for-file activities and then follow it up with a sequencer having the "any" or "all" option. So, if any one of the file appears then you can trigger your job activities.

Or if you need all the files to be present, then select the "all" option in the sequencer. This way you can trigger your job activities only when all the files have appeared.

Kumar's suggestion also is interesting. Did you try it out?

Thanks,
Naveen.

Posted: Mon Feb 27, 2006 3:27 pm
by chulett
The 'Wait For File' stage does not support wildcards, as far as I know.

Posted: Mon Feb 27, 2006 4:04 pm
by kumar_s
chulett wrote:The 'Wait For File' stage does not support wildcards, as far as I know.
Made a small test, wildcards doesnt work.
:evil:

Posted: Tue Feb 28, 2006 9:40 am
by Nsg
thanks all of your your response, and sorry for not being able to correspond ...

The wild card option, as everyone tested doesnot work, I hope some derivations could be made or some parameter can be passed while running the master sequencer...

if you have any suggestions please let me know

thanks all of you

nsg

Posted: Wed Mar 08, 2006 9:22 am
by ushasunkara
Hello Nsg,
Even i've come to the same point, where i've to wait for different files, and if file1 lands in the directory, my job activity 1 has to trigger,
if file2 lands, job activity2 has to trigger,
it's almost like ur query...
can u plz tell me how did u get your solution, if you found one,
what type of derivations or parameters did you use while running the master sequence.
Thank you so much...
and even if someone has some ideas...plz let me know,
thank you in advance
Usha...



Nsg wrote:thanks all of your your response, and sorry for not being able to correspond ...

The wild card option, as everyone tested doesnot work, I hope some derivations could be made or some parameter can be passed while running the master sequencer...

if you have any suggestions please let me know

thanks all of you

nsg

Posted: Wed Mar 08, 2006 9:47 am
by I_Server_Whale
Hi Usha,

Use the 'Wait-for-file Activity' before each of the 'Job Activity' that has to be triggerred when a file appears.

Thanks,
Naveen.

Posted: Wed Mar 08, 2006 10:21 am
by ushasunkara
*************************************************************

DataStage Repository interface

Record J\92\ROOT on file DS_JOBOBJECTS cannot be written

*************************************************************


This is the error i'm getting while compiling my job,

i've put wait for file stages in front of each job activity...

thank you...

Posted: Wed Mar 08, 2006 10:59 am
by I_Server_Whale
hi Usha,

I just created a sample sequence with your case.

i.e., Having a 'Wait-for-File Activity' in front of the 'Job Activity'

And everything compiled well.

I'm not sure why you are not able to do the same. Is there any other information we are missing?

Thanks,
Naveen.

Posted: Wed Mar 08, 2006 12:27 pm
by ushasunkara
Hi Naveen,
thank you so much for your time,
but i've done the same way,
ive put a wait for file1 -> job activity1
wait for file2 -> job activity2

both job activities to a Sequencer1 -> mail notification....

but even for saving it,

i'm getting the following error:

Unable to return an attached job

what may be the cause of it, i've checkd the jobs i specified in the job activity, they're running fine...
:(

plz tell me ur example sequence, and what all u've specified in the triggers.
thank you so much...
Usha...

Posted: Wed Mar 08, 2006 1:21 pm
by DSguru2B
try creating a simple sequencer job, just a couple of job activities linked with each other. and try to compile them.
from the error msg you are getting, it seems like your DS_JOBOBJECTS hash file is corrupted. try the test and let me know what happens.

Posted: Thu Mar 09, 2006 8:21 am
by ushasunkara
Hi,
thank you, it got resolved, it was some pblm with the server at tht time,
so waited for some time, and opened Designer again, it compiled well...
thank you...

Posted: Thu Mar 09, 2006 11:52 am
by ray.wurlod
If the file is placed on your server by an external scheduler, such as Ctrl-M or SeeBeyond, why not configure the same scheduler to start the DataStage job that has to process the file?

Posted: Thu Mar 09, 2006 11:58 am
by I_Server_Whale
That is a good point, Ray. We did the same at the last site. CNTRL-M was watching files to trigger subsequent processes.

Regards,
Naveen.