Checking for Finished/Restartable status in a routine

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

Post Reply
Gazelle
Premium Member
Premium Member
Posts: 108
Joined: Mon Nov 24, 2003 11:36 pm
Location: Australia (Melbourne)

Checking for Finished/Restartable status in a routine

Post by Gazelle »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Look for DSJ.JOBRESTARTABLE in JOBCONTROL.H (in the dsinclude directory in the project).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ajay.vaidyanathan
Participant
Posts: 53
Joined: Fri Apr 18, 2008 8:13 am
Location: United States

Checking for Finished/Restartable status in a routine

Post by ajay.vaidyanathan »

Hi,
Include the header file JOBCONTROL.H in your code and then try executing your DS Job. It should work.
Regards
Ajay
Gazelle
Premium Member
Premium Member
Posts: 108
Joined: Mon Nov 24, 2003 11:36 pm
Location: Australia (Melbourne)

Post by Gazelle »

Thanks.

I changed the routine to run the function with that paramater, and can now check the restartable flag, using: RestartableFlag = DSGetJobInfo(JobHandle,DSJ.JOBRESTARTABLE)

The guys here are a little concerned that because JOBRESTARTABLE is not documented in either the DSGetJobInfo description, or for dsjob -jobinfo, that the vendor might suddenly change the enumerated constants in JOBCONTROL.H and say "You're on your own".

However, for now our requirement is met.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I wouldn't worry about them changing the constants. The whole point of using these mnemonic constants rather than numeric values is so that they can change the numeric values yet maintain backwards compatibility. Since version 1.0 none has been changed, though many have been added.
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