same job run simultaneously with different parameters

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

same job run simultaneously with different parameters

Post by harshada »

Hi,

I wanted to know, can a same job be run simultaneously in two different sessions with different parameters passed to it?

We need to trigger the same job simultaneously with diff parameters.
So when I run a job from unix box using command

dsjob -run -jobstatus -param <parameter list > <project name> <job name>

and some one else also runs the same job,
firstly can this be done,
secondly if his job fails and mine is successful,
will i get the status of job as success or failure.
Same parallel and sever jobs need to be called simultaneously.

Please guide.

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

Post by ray.wurlod »

It can only be done if the job is capable of running multiple instances (this is a compilation option set in job properties). If the job is not capable of running multiple instances then the second attempt to start it will fail with a "job not in correct state" error, meaning that it is already running.

Multi-instance jobs are invoked with a unique "invocation ID" that is supplied as part of the job name. For example
dsjob -run -jobstatus -param <parameter list > <project name> <job name> .<invocationID>

There still may be issues. For example if the job writes to a text file with a hard-coded name, then one of the jobs (probably the second one started) will fail when it attempts to open that file for writing. This is an operation system restriction (only one writer), not a DataStage restriction, which means there's no workaround.

Different instances have different views of the job log table, so that the entries for each are presented separately by the Director client.
Therefore each instance is fully independent as far as status is concerned.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Hi Ray,

I could not see the premium content, but your first option, of allowing multiple instances, can this be done at the project level, which will imply to all jobs so that we dont need to change each and every job.

Thanks,
Harshada
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, the project level setting would only allow users to create multiple instance jobs. And not all jobs run correctly in multiple instances, i.e. if you have a hard-coded output sequential file.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Actually each file we are using in the job, is made unique by adding a code which comes as a parameter to the job. Will this make sure that multiple instances can run ok?

Also, the only way to make each job have multiple instances is to check the multiple instance property in the job? no other way?

If the property is checked in sequence, will it apply to all jobs?

Thanks,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Each job needs to be marked individually. You might be able to do this globally by exporting to .dsx or .xml and doing an editor global replace. Also, you should edit your sequences that call multi-instance jobs to ensure that they get the correct instance name. Checking the property in the sequence only makes the sequence multi-instance, not any of the jobs it calls.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Hi,

I marked the jobs for multiple instances and we ran 2 instances of the same job. Always one is running and other is not. Both are not running successfully. My job ran successfully with message

ERROR: Failed to lock job

Status code = -10 DSJE_JOBLOCKED
Finished waiting for job

Status code = 2


and the other session job failed with message


Error running job

Status code = -2 DSJE_BADSTATE
Before running
ERROR: Failed to lock job

Status code = -10 DSJE_JOBLOCKED.


Any suggestions? I am not a premium member hence could not read your full content. But we did try to run it parallely after setting the multiple instances for each job and sequence we are using.

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

Post by ray.wurlod »

Then become a premium member.

What invocation ID did you give in each case?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Hi Ray,

How can we pass the invocation id if i am running the job from the command prompt like

dsjob -run -jobstatus -param <parameter list > <project name> <job name>


If we create a new parameter for the invocation id... where do I pass it. I could not find this documented in the online doc. It tells about running from director and not from command prompt.

Thanks,
harshada
Premium Member
Premium Member
Posts: 92
Joined: Tue May 29, 2007 8:40 am

Post by harshada »

Hi Ray,

How can we pass the invocation id if i am running the job from the command prompt like

dsjob -run -jobstatus -param <parameter list > <project name> <job name>


If we create a new parameter for the invocation id... where do I pass it. I could not find this documented in the online doc. It tells about running from director and not from command prompt.

Thanks,
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

harshada wrote:Hi Ray,

How can we pass the invocation id if i am running the job from the command prompt like

dsjob -run -jobstatus -param <parameter list > <project name> <job name>


If we create a new parameter for the invocation id... where do I pass it. I could not find this documented in the online doc. It tells about running from director and not from command prompt.

Thanks,

Harshada,

I am away from workplace so could not give you exact syntax. Can you try.

Code: Select all

dsjob -run -jobstatus -param <parameter list > <project name> <job name>.invocation_id 
I hope this should work. Else if you are running the job from director/designer you can see a drop down box for invocation id. Just give in some values to the two instances.(Unique values) and your job is all set running in multiple instance.
Thanks
DSDexter
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

Oh! and I think you can find the command in the documentation(I guess manager guide). Or just type dsjob at command promt. It will guide you for wht all parameters it needs to sucessfully run the command. :D
Thanks
DSDexter
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Why not become a premium member. Ray gave you all of the necessary information in his first post. Isn't 2 hours of your time per problem worth the premium membership?

Mike
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ArndW wrote:No, the project level setting would only allow users to create multiple instance jobs.
There's no project level setting for this that I am aware of.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Craig - you are, of course, correct; there is no project-level switch allowing or disallowing Multi-instance jobs. I mixed that up with the project-level settings for RCP (runtime column propagation). The only place to actually enable multi-instance is in the job itself.
Post Reply