Checking for Finished/Restartable status in a routine
Posted: Tue Mar 15, 2011 7:40 pm
We are currently moving from v7.5 to v8.5 and hit a problem during testing.
The v7.5 design for batch submissions was:
...Enterprise scheduler -> Unix script -> "Ignition" Sequence -> "Functional" Sequence -> DataStage job(s)
The "Functional" Sequences were coded to set checkpoints and automatically handle aborts. They have an ExceptionHandler that linked to a Seqeuencer (but unfortunately, the sequencer does not then link to a Termination activity).
If any of the jobs failed, the "Functional" Sequence was put in Aborted/Restartable status, and this was checked by a routine called by the "Ignition" Sequence. The routine calls the DSGetJobInfo function to get the status, and if it is a fail status, writes the details to a database table.
What we are now finding in v8.5:
If any of the jobs failed, the Functional Sequence would be in Finished/Restartable status. The "Ignition" sequence did not pick up that the called sequence had failed, because the DSGetJobInfo function returned status=1 (i.e. Run OK).
When running the "dsjob -jobinfo" command from Unix, it showed that the Sequence status was indeed "1". It also had a "Job restartable: 1" flag.
My guess is:
- If one of multiple jobs fails, v8 handles it slightly differently than v7.5, and sets the Sequence status to "Finished/Restartable", meaning a Sequence was not told to "abort", however one of its jobs failed.
- Such a scenario is identified by getting the jobinfo and looking at both the "job status" and the "job restartable" status.
Am I on the right track?
If so, I cannot find in the documentation what parameter I need to pass to the DSGetJobInfo function to return the "Job Restartable" value.
Can anyone point me in the right direction?
Alternatively, we could execute a unix shell to run the "dsjob -jobinfo" and grep for "Job restartable"... but I'd rather use DSGetJobInfo directly from the routine.
The v7.5 design for batch submissions was:
...Enterprise scheduler -> Unix script -> "Ignition" Sequence -> "Functional" Sequence -> DataStage job(s)
The "Functional" Sequences were coded to set checkpoints and automatically handle aborts. They have an ExceptionHandler that linked to a Seqeuencer (but unfortunately, the sequencer does not then link to a Termination activity).
If any of the jobs failed, the "Functional" Sequence was put in Aborted/Restartable status, and this was checked by a routine called by the "Ignition" Sequence. The routine calls the DSGetJobInfo function to get the status, and if it is a fail status, writes the details to a database table.
What we are now finding in v8.5:
If any of the jobs failed, the Functional Sequence would be in Finished/Restartable status. The "Ignition" sequence did not pick up that the called sequence had failed, because the DSGetJobInfo function returned status=1 (i.e. Run OK).
When running the "dsjob -jobinfo" command from Unix, it showed that the Sequence status was indeed "1". It also had a "Job restartable: 1" flag.
My guess is:
- If one of multiple jobs fails, v8 handles it slightly differently than v7.5, and sets the Sequence status to "Finished/Restartable", meaning a Sequence was not told to "abort", however one of its jobs failed.
- Such a scenario is identified by getting the jobinfo and looking at both the "job status" and the "job restartable" status.
Am I on the right track?
If so, I cannot find in the documentation what parameter I need to pass to the DSGetJobInfo function to return the "Job Restartable" value.
Can anyone point me in the right direction?
Alternatively, we could execute a unix shell to run the "dsjob -jobinfo" and grep for "Job restartable"... but I'd rather use DSGetJobInfo directly from the routine.