Page 1 of 1

How to parametrized wait for file activity stage

Posted: Mon Jun 08, 2009 4:36 am
by srai
Hi All,

I have requirement in DataStage to wait for a list of files to be present in a UNIX folder and check if all the files are present then proceed otherwise terminate the job.

1) How do we pass more than one file name in wait for file activity stage?
2) How do we parametrized the file names. Mean i am getting files based on dates...like

06082009_ABC.txt, 06082009_EFG.txt -- for June 08 2009
06092009_ABC.txt, 06092009_EFG.txt -- for June 09 2009
06102009_ABC.txt, 06102009_EFG.txt -- for June 10 2009

Please let me know if some one has worked on this type of requirement.
Thanks in advance!

Regards,
-Santosh

Posted: Mon Jun 08, 2009 4:49 am
by ArndW
The stage itself will only take one filename, but if you need to wait for all the files you can just put them sequentially, one stage per file. If more "intelligence" is needed then you could always call a shell script from your job and return an appropriate code for "all files present" or "waited too long".

Posted: Mon Jun 08, 2009 4:55 am
by srai
ArndW wrote:The stage itself will only take one filename, but if you need to wait for all the files you can just put them sequentially, one stage per file. If more "intelligence" is needed then you could always c ...
Thanks for response.

I have one more requirement that is to parametrized the file name based on the Date...As I mentioned file names of like

06082009_ABC.txt for June 08
06092009_ABC.txt for June 09 means (_ABC.txt ) files name is prefixed with the Date and which not fixed. How do we check that part.

Posted: Mon Jun 08, 2009 5:16 am
by ArndW
What is preventing you from using parameters for the file names in the stage?

Posted: Mon Jun 08, 2009 6:07 am
by srai
ArndW wrote:What is preventing you from using parameters for the file names in the stage? ...

My question is how to generate the parameter for the date so that it would read the file name as

06082009_ABC.txt on June 08 run
06092009_ABC.txt ... on June 09 run
and so on in wait for file activity stage for every date.

Posted: Mon Jun 08, 2009 6:21 am
by chulett
Many ways. A custom routine could get and format the date you pass to the stage, you could get it from the operating system with an Execute Command stage, etc etc.