Wait for directory to have file(s)

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
Nsg
Premium Member
Premium Member
Posts: 37
Joined: Thu Jan 26, 2006 1:21 pm

Wait for directory to have file(s)

Post 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
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Try /path_name/* under filename optoin.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
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 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.
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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The 'Wait For File' stage does not support wildcards, as far as I know.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post 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:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Nsg
Premium Member
Premium Member
Posts: 37
Joined: Thu Jan 26, 2006 1:21 pm

Post 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
ushasunkara
Participant
Posts: 23
Joined: Wed Jan 18, 2006 10:43 am

Post 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
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 Usha,

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

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
ushasunkara
Participant
Posts: 23
Joined: Wed Jan 18, 2006 10:43 am

Post 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...
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 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.
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
ushasunkara
Participant
Posts: 23
Joined: Wed Jan 18, 2006 10:43 am

Post 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...
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ushasunkara
Participant
Posts: 23
Joined: Wed Jan 18, 2006 10:43 am

Post 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...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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 »

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.
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