Page 1 of 1

How to run the same sequencer over and over each day

Posted: Fri Jul 30, 2010 1:53 pm
by Marley777
Hi, how can I run the same sequencer over and over daily? For example a sequencer will need to be schedued so that it runs hourly Monday through Friday between 6:AM and 11:PM. The DataStage scheduler in director is limited.


Thanks for your help.

Posted: Fri Jul 30, 2010 2:01 pm
by ray.wurlod
You can create a parent sequence that looks after the loop within a day, and schedule this parent sequence once per weekday.

Posted: Fri Jul 30, 2010 2:08 pm
by Marley777
Hi Ray, thanks for responding, can you please elaborate.

Posted: Fri Jul 30, 2010 2:21 pm
by kris007
You need to create a Job Sequence lets say A with a Start Loop, Job Activity and End Loop. The Counter in the Start Loop should be set how many times you want the job to run. Now, you need to create another Job Sequence(Master/Parent Sequence) with Job Sequence A in it and schedule the Master Sequence once per week day as Ray mentioned.

Hope that helps.

Posted: Fri Jul 30, 2010 2:23 pm
by chulett
The "DataStage scheduler" is simply an interlude to cron. There's nothing stopping you from doing an "Add to schedule" for every hour in that range except that it would be rather tedious. Don't recall if you can specify "Every weekday" there or not, worst case you would have to repeat that range of hours five times.

Ray is suggesting a master Sequence job that you schedule to start at 6AM each weekday and inside a loop it runs the other sequence (or job) and then waits/sleeps for an hour before continuing the loop. It would loop 18 times and then exit. Only one thing to schedule per day that way.

Posted: Fri Jul 30, 2010 2:23 pm
by Marley777
Thanks Ray
Thanks Kris

Posted: Fri Jul 30, 2010 2:24 pm
by Marley777
Thanks everyone

Posted: Fri Jul 30, 2010 2:27 pm
by chulett
On the subject of sleeping, unless your job runs very very quickly it can't afford to sleep for the full 60 minutes, if you do you will slowly start creeping past your straight-up hour start time.

When I had to do this in the past, I recorded the end time of the looped job and then computed how many minutes were left until "the top of the hour". The sleep routine inside the loop then slept that long. For example, the job starts at 8AM and finishes at 8:12, the routine then needs to sleep 48 minutes so that the next run starts on time at 9AM.