How to parametrized wait for file activity stage

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
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

How to parametrized wait for file activity stage

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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".
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

What is preventing you from using parameters for the file names in the stage?
srai
Participant
Posts: 101
Joined: Wed Feb 09, 2005 10:50 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

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

"You can never have too many knives" -- Logan Nine Fingers
Post Reply