Job Status for Embeded Sequence

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
jlockwo
Participant
Posts: 11
Joined: Tue Aug 17, 2004 12:51 pm

Job Status for Embeded Sequence

Post by jlockwo »

I searched the forum and didn't see this particular question, so I hope it's not a too often repeated inquiry!

We have one sequence that runs many sequences (I'll call them subsequences), the subsequences run many jobs. I've got it set up with the trigger conditions so that within the subsequences if one of the jobs fail, it won't continue within that sequence. The job will abort and the subsequence will return to the main sequence with a job status of 1. Is there a way to make the subsequence's job status reflect the highest status of one of the jobs? If not, what is the standard way to handle this type of situation?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you're running 7.5 there is a rich set of expressions you can use in custom triggers. You could use these with the exit status variables of the jobs in the Sequence.

If earlier than 7.5 you're up for a complex web of triggers; all normal exits go through an Any sequencer to the LogEntry routine, all warning exits go through an Any sequencer to the LogWarn routine. I'm assuming that none of your production jobs abort.

The controller can then pick up the exit status of the Sequence; if any job had had a warning, then there will be a warning logged in the Sequence's log, so its exit status will be 2 (finished (see log)).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jlockwo
Participant
Posts: 11
Joined: Tue Aug 17, 2004 12:51 pm

Post by jlockwo »

Yeah, that's the trouble I'm having. I have a sequence with 3 steps. Sequence 1 followed by Sequence 2 followed by Sequence 3.

Sequence 1 consists of 2 server jobs; say server job a and b.

I don't want sequence 2 to run if server job a has failed. However, when I set up the custom trigger using the rich expression, it doesn't recognize server job a as a jobname, since it is embeded in Sequence 1. All sequence 2 can see is sequence 1, whose return codes are always fine, even if server job a AND b failed.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's why you need to make Sequence 1's return code not fine when any of the jobs have issues. You must have missed this in Ray's post:
ray.wurlod wrote:all warning exits go through an Any sequencer to the LogWarn routine
By writing a warning to the sequences log when a job fails, your trigger will pick up on that and not continue downstream.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The "complex web" I described has to be in Sequence1, handling the exit status of job a and job b.

Code: Select all

    joba  (Warn)  ---------->  Any1  --------> LogWarn (Routine)
                                |
    jobb  (Warn)  --------------+
You don't really need the LogEntry path I described.
You can handle aborts through the same Any sequencer so that a warning is logged.

The main sequence detects the exit status of Sequence 1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jlockwo
Participant
Posts: 11
Joined: Tue Aug 17, 2004 12:51 pm

Post by jlockwo »

Ahh, I see. I'll see if I can get that to work. Thanks for the help! I hate wandering around endlessly...trying many, many, many different solutions (none of which work). So, it's good to be pointed in the right direction!!!
Post Reply