dsjob command
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
dsjob command
Hi All,
How can i trap the status of the job thru dsjob command .If any job gets aborted then is it necessary to compile the job in the designer before running the dsjob command ?
How can i trap the status of the job thru dsjob command .If any job gets aborted then is it necessary to compile the job in the designer before running the dsjob command ?
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
The job should be a job and not a sequence. The problem of status is even if the job is getting aborted the status still returns as 0 which is making difficult to get the status of the job. I want that for those runs for which the status is aborted the status should be something else which helps me in detect the error.OddJob wrote:Place the Job on a Sequence and call the Sequence from dsjob.
If you double-click on the Job Activity on the Sequence and select the 'Job' tab you can choose 'Reset if required, then run' from the 'Execute action' dropdown - your job will always run even if it is in status 'Aborted'.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The job status is available on file unit #2 (stderr). If you specify the -jobstatus option, the job status of dsjob is the exit status of the job itself, on file unit #1 (stdout). It is documented thus.
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.
Re: dsjob command
1) Use the -jobstatus dsjob option as noted. The behaviour of it is well documented.pravin1581 wrote:1) How can i trap the status of the job thru dsjob command. 2) If any job gets aborted then is it necessary to compile the job in the designer before running the dsjob command ?
2) No. It does need to be RESET however and there is a specific dsjob 'run mode' for that. Your wrapper script needs to check for a condition requiring a reset and do so before running the job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
Re: dsjob command
I have tried using the option mode RESET, it resets the job but the job is not running.The command that i have tried is as follows:chulett wrote:1) Use the -jobstatus dsjob option as noted. The behaviour of it is well documented.pravin1581 wrote:1) How can i trap the status of the job thru dsjob command. 2) If any job gets aborted then is it necessary to compile the job in the designer before running the dsjob command ?
2) No. It does need to be RESET however and there is a specific dsjob 'run mode' for that. Your wrapper script needs to check for a condition requiring a reset and do so before running the job.
Code: Select all
dsjob -run -mode RESET projectname jobname
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
I have included -jobstatus in the command and it is working fine. It returns 2 if there is any warning in the job else 3 if the job is aborted and 1 if it is finished w/o any warning. But the problem of compiling still persists, it has to be compiled if it is getting aborted.ray.wurlod wrote:Any messages generated?
What is the exit status of dsjob?
Include -jobstatus option and post whether that makes a difference.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It does NOT have to be re-compiled if it aborted. It only needs to be reset. You can accomplish this with dsjob -run -mode RESET ...
You can also accomplish it automatically ("reset if required, then run") if running your job from a job sequence - the job sequence can be started from dsjob.
You can also accomplish it automatically ("reset if required, then run") if running your job from a job sequence - the job sequence can be started from dsjob.
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.
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
In case of job sequence i am aware of this property ("reset if required, then run") but i want the same in case of a job and not job sequence.ray.wurlod wrote:It does NOT have to be re-compiled if it aborted. It only needs to be reset. You can accomplish this with dsjob -run -mode RESET ...
You can also accomplish it automatically ("reset if required, then run") if running your job from a job sequence - the job sequence can be started from dsjob.
There is no "reset if required" from the command line, but you can always just force a reset and then run the job.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 497
- Joined: Sun Dec 17, 2006 11:52 pm
- Location: Kolkata
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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?
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?
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.