Cannot run multiple instances of a job

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
sdupre
Participant
Posts: 7
Joined: Mon Mar 01, 2004 3:30 pm

Cannot run multiple instances of a job

Post by sdupre »

Hi everyone,

I absolutely cannot figure out how to run multiple instances of a job.

What I actually need to do is more complex than this example but for the sake of argument I made the simplest possible job I could think of and run multiple instances of it.

Here's what I did :

Created a job that reads lines from a file and copies it to another. That's it, it does nothing else and it works fine.
I obviously selected "allow multiple instance" in the job properties.

The input and output filenames are passed as parameters.

Now what I want to do is simultaneously run two instances of this job to work on totally different files.

I have a script that starts those jobs as follow :

dsjob -run -param p1="i1" -param p2="o1" myProject TEST_MULT &
dsjob -run -param p1="i2" -param p2="o2" myProject TEST_MULT &

In theory what this should do is the first job should read from i1 and write to o1 and the second job should read from i2 and write to o2.

It works fine when I run them sequentially but when I run them at the same time, I either get "Status code = -2 DSJE_BADSTATE" or "Status code = -10 DSJE_JOBLOCKED"

Is something misconfigured, is this a bug, or am I misunderstanding what "multiple instances" should do ??
sdupre
Participant
Posts: 7
Joined: Mon Mar 01, 2004 3:30 pm

Post by sdupre »

Did some more tests...

When I run 10 instances of this job, I get anywhere between 3 and 6 successes, it's never consistent.

seems buggy to me.

I'll log a support call I think.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Cannot run multiple instances of a job

Post by chulett »

sdupre wrote:Is something misconfigured, is this a bug, or am I misunderstanding what "multiple instances" should do ??
You can't just simply start the same jobs multiple times. You need to start the job and specify a different Invocation ID for each run - this is what allows them to run simultaneously. For example:

Code: Select all

dsjob -run -param p1="i1" -param p2="o1" myProject TEST_MULT.o1
dsjob -run -param p1="i2" -param p2="o2" myProject TEST_MULT.o2
Note the extra dot and text at the end of the job name. This is the Invocation ID, which is user-defined. Check your online help for more on this subject.

FYI - There's no need to run these commands in the background. If you do not specify the -wait option then it will not wait for the job to finish before moving on to the next command.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sdupre
Participant
Posts: 7
Joined: Mon Mar 01, 2004 3:30 pm

Post by sdupre »

That worked. Thank you very much, you are a life saver.

Can you tell me where that syntax is documented ? I could not find it anywhere.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

A good place to start is with the online help available from the Director. Bring up the Index entry for "Multiple Job Instances" and go from there!
-craig

"You can never have too many knives" -- Logan Nine Fingers
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Go to your Start button and descend to the Ascential client software folder and then go to Online Documentation. Everything you could ever need is there.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply