running job instances in parallel mode

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
pstefani
Participant
Posts: 5
Joined: Thu Jun 30, 2005 5:03 am

running job instances in parallel mode

Post by pstefani »

Hello all,

Here is my problem :
I have a table in my database which contains two columns. Let's call them C1 (String) and C2 (Booelan).
I created a sequence job in DS. This job is a multiple instance job.
For each C1 having C2 set at True, I want this job to be launched with the instance set at C1, and I want these instances to run in parallel.

Any idea of how I could do that ?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

pstefani,

I am not really sure what you are trying to ask here, but if you were to write your multi-instance job that reads your table and pass in a parameter which is used in your SELECT clause, in one job it would be "where C2 = TRUE" and the other "where C2 = FALSE". Start this job in parallel from a sequence with the different parameter values and you will get two jobs running at the same time and using different datasets.
ameyvaidya
Charter Member
Charter Member
Posts: 166
Joined: Wed Mar 16, 2005 6:52 am
Location: Mumbai, India

Post by ameyvaidya »

From what I've understood, a multi instance job needs to be run.

The invocation ID's are to be = C1.

The Number of invocations is the count of C1 where C2= true.

Question:
Are there any job parameters to be passed to the Job?
Do they vary from invocation to invocation?

Simplest way would be to

Have a sequence that:

1 Calls a Job that writes all C1 to a sequential file where C2=true;
2. Write a routine that reads the Sequential file and Runs the Multi-Instance Job once per row with the invocation Id set to the read value(You can use a batch Jobs to generate the Job run code) The Parallel run can be achieved by not waiting for Jobs to finish..

IHTH,
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Use the Batch Job build tool as a short cut to generating your routine code. In the Director choose Tools - Batch - New from the menu. This creates a new batch job. Find your multiple instance job in the combo box and hit the add button, you will get a job parameter prompt and it will add all the code to run the job into the text box. You can copy and paste this to your routine.

As pointed out by ameyvaidya you will need to move or remove the DSWaitForJob command so that you can run multiple DSRunJob commands with different instance IDs to get your parallel runs.
pstefani
Participant
Posts: 5
Joined: Thu Jun 30, 2005 5:03 am

Post by pstefani »

Thanks,
I somehow achieved to never run a job from a routine before. You're right, the whole thing is in removing DSWaitForJob.
Thanks again,
Pierre.
Post Reply