Scheduling a job with input file frequency unknown

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
dsx_newbie
Participant
Posts: 6
Joined: Thu Jan 04, 2007 3:46 am
Location: Malaysia

Scheduling a job with input file frequency unknown

Post by dsx_newbie »

What is the best way to schedule if the frequency of the input file is unknown?

Should I create a shell script that checks if the input file is existing in the input directory, if existing the shell script runs the job.

Is there another/best way of doing this?

TIA
wnogalski
Charter Member
Charter Member
Posts: 54
Joined: Thu Jan 06, 2005 10:49 am
Location: Warsaw

Post by wnogalski »

You can use "Wait For File Activity" in your sequence.
Regards,
Wojciech Nogalski
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Or if you are using an enterprise scheduler like Control-M or Tivoli, they have a file watcher in place. You can utilize that as well.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

All would work and be fine, not sure any one is 'best' or especially better than the other unless it more closely aligns with your company's standards.

In any case, the job (or script) could be scheduled and run each day and if there's nothing to do then do not run the processing job. If you want to keep it all in DataStage, then the WFF suggestion is best as you can set it to wait for 'zero seconds' and what you get is a one-time existence check.

Then from the WFF stage in your Sequence job run two triggers - 'OK (Conditional)' which will fire when the file is found or an 'Otherwise' which will fire when it is not found. Do whatever is appropriate for each link - run the processing job, send an email, do nothing...

Oh, and Welcome Aboard! :D
-craig

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