same job run simultaneously with different parameters
Moderators: chulett, rschirm, roy
same job run simultaneously with different parameters
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
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
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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,
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,
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.
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.
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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,
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,
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,
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 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
Thanks
DSDexter
DSDexter