Page 1 of 1

running job instances in parallel mode

Posted: Thu Dec 15, 2005 11:38 am
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 ?

Posted: Thu Dec 15, 2005 12:32 pm
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.

Posted: Thu Dec 15, 2005 1:08 pm
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,

Posted: Thu Dec 15, 2005 7:35 pm
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.

Posted: Fri Dec 16, 2005 8:09 am
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.