Sequencer job status when command activity fails
Moderators: chulett, rschirm, roy
Sequencer job status when command activity fails
dsjob is returning 0 even when command activity fails.
I am working on a script that calls dsjob to submit a DS sequencer. The Sequencer contains job activities and command activities. The script is looking for the return code coming from the dsjob command expecting a non-zero value if anything fails. I have tried both the -wait and the -jobstatus options. The job returns a 1 when the job called by the job activity fails but if a command activity fails, it still returns a 0.
How do I get a non-zero return code from the sequencer when a command activity fails?
I am working on a script that calls dsjob to submit a DS sequencer. The Sequencer contains job activities and command activities. The script is looking for the return code coming from the dsjob command expecting a non-zero value if anything fails. I have tried both the -wait and the -jobstatus options. The job returns a 1 when the job called by the job activity fails but if a command activity fails, it still returns a 0.
How do I get a non-zero return code from the sequencer when a command activity fails?
Bob
You need the Sequence itself to fail or at least log a warning when there are issues with the processes it runs and there are many ways to accomplish that. There are compiler options in the Job Properties tab, for instance, or the Terminator stage to name a couple of things.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
actually to be a bit more precise, the command is a sudo command to execute a script.
In director I see the following:
In director I see the following:
Code: Select all
RMKD400W..JobControl (@TRANSFER2MAINFRAME): Command sudo did not finish OK, reply = '1'
RMKD400W..JobControl (@Coordinator): Summary of sequence run
12:13:02: Sequence started (checkpointing on)
12:13:02: P_RMK_SVOC_GetEmailInfo (JOB P_RMK_SVOC_GetEmailInfo) started
12:13:03: P_RMK_SVOC_GetPhoneInfo (JOB P_RMK_SVOC_GetPhoneInfo) started
12:16:14: P_RMK_SVOC_GetPhoneInfo (JOB P_RMK_SVOC_GetPhoneInfo) finished, status=1 [Finished OK]
12:19:15: P_RMK_SVOC_GetEmailInfo (JOB P_RMK_SVOC_GetEmailInfo) finished, status=1 [Finished OK]
12:19:15: TRANSFER2MAINFRAME (COMMAND sudo) started
12:19:15: TRANSFER2MAINFRAME finished, reply=1
12:19:15: Terminator_Activity Executed
12:19:15: Sequence terminated
RMKD400W..JobControl (fatal error from @Terminator_Activity): RMK0428D: SVoC - TD Sync Aborted
Attempting to Cleanup after ABORT raised in job RMKD400W..JobControl
Job RMKD400W aborted.
Bob
In a way, that doesn't really matter. The Sequence ran the process and that was all it was tasked to do and it was able to do it. The same could apply to Job Activities or any other stage in the Sequence... unless the Sequence itself has a problem, it's going to report back that it ran just fine.
So, from your log you have a Terminator in the stream somewhere? What settings do you have there and what is the actual status of the Sequence job when the dust settles? Something other than 'Finished OK'?
So, from your log you have a Terminator in the stream somewhere? What settings do you have there and what is the actual status of the Sequence job when the dust settles? Something other than 'Finished OK'?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
It should, as long as you use one or the other. The -jobstatus option gives you 1,2,3 (etc) which match the internal numbers DataStage uses whereas the -wait should be zero or some kind of non-zero return as you've noted. If that's not happening, it may be an 8.x issue and one you should raise with your official support provider. IMHO.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
dsjob -run returns its own exit status; if the job request was made successfully then the correct exit status for dsjob is 0.
However, the -jobstatus option has a side effect of causing dsjob -run to exit with the exit status of the job itself.
However, the -jobstatus option has a side effect of causing dsjob -run to exit with the exit status of the job itself.
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.