check job status in routine without waiting for completion

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
wuruima
Participant
Posts: 65
Joined: Mon Nov 04, 2013 10:15 pm

check job status in routine without waiting for completion

Post by wuruima »

Hi all.

In a routine, I use a for loop to trigger parallel jobs. I would like these jobs to run in parallel instead of in sequentially.

But how can I detect the status of the jobs at the end of the routine?

I need to make sure the parallel jobs completed successfully and then finish the routine processing.
wuruimao
wuruima
Participant
Posts: 65
Joined: Mon Nov 04, 2013 10:15 pm

Re: check job status

Post by wuruima »

I don't want to run DSWaitForJob every time. the jobs could run at the same time.
wuruimao
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Set up (or find) a Sequence job with multiple unconnected Job Activity stages. No need to actually run it but rather examine the job control code that it generates. From what I recall, you should be able to find the code where it starts all of the jobs and then issues a single DSWaitForJob function call with a list of all of the PIDs running to wait for.

Meaning it is possible and the code for it is out there... or can be.
-craig

"You can never have too many knives" -- Logan Nine Fingers
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

would a sequencer work, where you fed all the jobs that start at once into a single sequencer and checked after that to see if you can proceed?

I have not done this, its just an idea to try.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope, at least not via a Job Activity stage which automatically does a "wait" making them run in a serial manner. At least that's what I recall. It would provide a gate, however, and not proceed until all are complete (assuming it is set that way) but won't affect parallel versus serial in the running of the jobs coming into it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post by Teej »

Plus there are a number of settings that limit the actual number of jobs being kicked off by the Job Sequencer. I do not have a reference handy to help guide you just yet, but this is tunable.

Have you considered using Workload Manager to help manage your resources (available in 9.1+), while throwing out as many jobs as you can?

-T.J.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DSWaitForJob() can wait for multiple jobs.

Review the job control code generated by a sequence job to see how (essentially a dynamic array of job handles).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted earlier. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
wuruima
Participant
Posts: 65
Joined: Mon Nov 04, 2013 10:15 pm

Post by wuruima »

very useful. Thanks all.
wuruimao
UCDI
Premium Member
Premium Member
Posts: 383
Joined: Mon Mar 21, 2016 2:00 pm

Post by UCDI »

"It would provide a gate, however, and not proceed until all are complete"

Right, this is what I was thinking -- for simple needs, it would be sufficient, if all you need is "wait for 1-5 before kicking off 6".
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes, true... that is exactly what they are for.
-craig

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