dsjob command

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

pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

ray.wurlod wrote:FORGET re-compile. It is not necessary!

You can reset the job from dsjob.
You can even test whether it needs to be reset (Aborted = 3).

After resetting, the job status will be 21 (has been reset).
Then you can run the job normally.

No need to re-compile.

Are you listening?
I have used the following command :

Code: Select all


   dsjob -run -mode RESET -wait -jobstatus <projectname> <jobname>

 The job status is 21 and in the director the status shows "has been reset" but the job is not running.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

dsjob - reset will only reset the job. You need to run the job after resetting the job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Job status 3 means that the job is not in a runnable state (and must be reset).

Job status 1, 2 or 21 mean that the job is in a runnable state (and need not be reset).

Job status 0 means that the job is running, and can not therefore successfully process a run request.

There are other status values, but these cover the gamut of normal operation.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted, you should first check the job status using dsjob to determine if it needs to be reset. Then only if it needs to be reset, reset it as shown. Lastly, actually run the job.

This is bog standard 'dsjob wrapper script' stuff.
-craig

"You can never have too many knives" -- Logan Nine Fingers
michael_west
Premium Member
Premium Member
Posts: 7
Joined: Mon Jul 25, 2005 8:40 am

Post by michael_west »

The other code I have seen regularly is 255. It seems to mean "something is horribly wrong" Resetting is required.

For sequencers a reset is optional when the status is 3. If you want checkpoint restartability then you should not reset before running when the status is 3 since the job will restart from the beginning. You have reset the checkpoints.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

ray.wurlod wrote:Job status 3 means that the job is not in a runnable state (and must be reset).

Job status 1, 2 or 21 mean that the job is in a runnable state (and need not be reset).

Job status 0 means that the job is running, and can not therefore successfully process a run request.

There are other status values, but these cover the gamut of normal operation.
I have tested it by designing a simple job which reads from a file then there is a sort stage to sort it and then the output is written in the output file. Then I incorporated an extra column in the output file which has no mapping in the sort stage. Then i run the job from the designer and as expected the job gets aborted . Then i remove that extra column and save the job and the job should run now. Then i reset the job with the following command :

Code: Select all


   dsjob -run -mode RESET <projectname> <jobname>
In the director the status of the job is RESET. Then i run the following command:

Code: Select all


  dsjob -run -wait -jobstatus <projectname> <jobname>
Then the job is getting aborted with the same error as in the previous case , but if i compile the job and then run it from dsjob then it is running ok. Is it necessary to compile the job so the changes get reflected.Please look into it and for the RESET command the status code is 0.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

that sounds like a bug. If you RESET the job from the director, does the dsjob -run still fail? Also, will it fail after a RESET if run from the director?
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Arnd,

Pravin's job failed because he ran the job without compiling the changes he had made. Is this not correct?

Am i missing something? :oops:
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

balajisr, you are right. ARRGG!!! I missed that part of his description. The job, after saving changes, has a status of not compiled and therefore cannot run.
pravin1581
Premium Member
Premium Member
Posts: 497
Joined: Sun Dec 17, 2006 11:52 pm
Location: Kolkata
Contact:

Post by pravin1581 »

ArndW wrote:balajisr, you are right. ARRGG!!! I missed that part of his description. The job, after saving changes, has a status of not compiled and therefore cannot run.
Then my previous assertion that job needs to be compiled from the designer after it gets aborted before running it by dsjob command or if the job gets aborted for the absence of any input file which was getting created in the previous job , bcoz the previous job failed then RESET option might work, if there is any design related issues then the job needs to be compiled after making the necessary changes to make it executable.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Re-compile is only required if you have changed the job design.

If you have not changed the job design, you do not need to re-compile. Reset is sufficient if the job has aborted and its design is not changed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply