Running multiple jobs

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Running multiple jobs

Post by xch2005 »

Hi,

There are 100 parallel jobs which needs to be run. They can all run independently as their source + target tables are different in each job.

The records processed would be bit on the higher side and not sure on how many jobs can be run simultaneously in a sequence.

Is there a way in which I can kick off 5 jobs first then if 1 of them finshes then push 1 from the waiting list to start and so on? By this at any point I would have 5 runs in execution or please let me know if there are any other options.

Thanks for your time.

Thanks.
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

I have seen that done. It's a bit more complex but is possible. I have not had to setup a queue like that myself. I would want the limit (i.e. 5) to be a parameter, or at least easily changed. For example, you may find that 4 or 10 is an ideal limit.

A simple option is to create a sequence job with 5 separate sets of 20 jobs each. Each of the 20 jobs are linked to run one after the other. The 5 sets automatically run in parallel to each other because they're not linked to each other. This option is less flexible when it comes to changing your limit. It also requires some manual balancing of the longer running jobs across sets.
Choose a job you love, and you will never have to work a day in your life. - Confucius
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

DataStage's built-in scheduler would not be able to perform this type of scheduling. This is a task that is a perfect fit for any of several workload scheduler products on the market.

You may be able to pull it off using a job sequence as Eric suggests or, more than likely, a BASIC routine which could loop through a list of stored dsjob commands and poll the status of currently active jobs.

Regards,
- james wiles


All generalizations are false, including this one - Mark Twain.
Gazelle
Premium Member
Premium Member
Posts: 108
Joined: Mon Nov 24, 2003 11:36 pm
Location: Australia (Melbourne)

Post by Gazelle »

Yes, we did something like this, using a Unix script.
Basically, as James suggested, the script loops through a set of dsjob commands.
e.g.
1. Build a file with a record for each of the parameters to be used for the dsjob command.
2. Loop for each of the records.
2a. Build & submit the dsjob command, without waiting for a status (in our case, we submitted the command as a background task, using the "&" suffix).
At this point, you could include another loop, e.g. if the maximum number of concurrent jobs is reached, it waits until one of the jobs has finished.
3. Loop until all of the jobs have finished.
3a. Check the status of any of the completed jobs
(in our case, our jobs wrote their status to a file when they finished, so the script kept monitoring the file, then set the script to fail if any jobs failed).
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

KBA Job Control Utilities. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

Thanks for letting know the options.
Post Reply