Sequencer issue

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

pat_raman2000
Premium Member
Premium Member
Posts: 16
Joined: Tue Apr 17, 2007 12:38 am

Sequencer issue

Post by pat_raman2000 »

I am having sequential dependencies with multiple job activities.I have created custom conditional option with job_activity1.jobstatus=0 that is job needs to go second job when there is ok condition .Sequncer works well when there is abort condition (status =2).it restarts from where it left when abort is encountered

But if it is warning it logs warning and stops at job that invoked warnings and gives status finished instead of abort.

can anyone help on this
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:idea: Use normal triggers, no need for anything custom here and you are just confusing the automatic error handling.

For 'Finished' use 'OK - (Conditional)'.
For 'Finished (see log)' use 'Warning - (Conditional)'
For 'Aborted' use 'Failed - (Conditional)'

For anything not covered by the stage's current triggers use 'Otherwise'.

ps. Job Status runs from 1 thru 3 for the above, not 0 thru 2. A zero means 'running'. And it's a Sequence job (no 'r') - the Sequencer is a specific stage used in a Sequence job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pat_raman2000
Premium Member
Premium Member
Posts: 16
Joined: Tue Apr 17, 2007 12:38 am

Post by pat_raman2000 »

job1->job2->job3

Even if i set job dependencies as ok conditional and runs when it encounters warning at Job1 it is saying the sequencers is completed and not shows abort.

My requirement is when it encounters warning it should abort and be there at Job1
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then you must build this in - "automatic" handling only applies when a job (or other) activity actually fails - aborts. Take a Warning trigger from your job activity and run it into a Routine activity that invokes UtilityFatalToLog() routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, but that isn't true. Enable automatic handling and then include only an OK trigger to the next job - it will abort the Sequence for anything else, including warnings.

Job3 will need an 'OK' trigger as well for everything to work properly when it has a problem. Add a sequencer to the job and link Job3 to it:

Code: Select all

Job1 -OK-> Job2 -OK-> Job3 -OK-> Sequencer
:!: Edited to add - Got that first bit wrong, however please see the later post which explains the circumstances that allow this to work.
Last edited by chulett on Sun Jun 01, 2008 8:33 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Re: Sequencer issue

Post by ag_ram »

pat_raman2000 wrote:I am having sequential dependencies with multiple job activities.I have created custom conditional option with job_activity1.jobstatus=0 that is job needs to go second job when there is ok condition .Sequncer works well when there is abort condition (status =2).it restarts from where it left when abort is encountered

But if it is warning it logs warning and stops at job that invoked warnings and gives status finished instead of abort.
You do have an incomplete solution for your problem. So I pose a question here.

Though you give Job Status OK in the Trigger to trigger up the next Activity when the Job finished without warning, how did you handle the situation, where the Job was NOT finished without warning?

For your infomation:

Job Sequence, after executing the selected Job in the Job Activity, checks the all trigger conditions defined out there. If no Trigger Condition is satisfied, then Job Sequence does not proceed further but simply finishes its execution with status Finished.

Solution:

I can almost recommend the same solution what ray.wurlod suggested in his second line.

Code: Select all

[Job Act1] --(OK)--> [Job Act2] --(OK)--> [Job Act3]
      |                  |                  | 
   (Warn)              (Warn)             (Warn)
      |                  |                  | 
      v                  v                  v
 [Rtn Act1]         [Rtn Act2]          [Rtn Act3]  
The Sequencer Activity in the Job Sequence is not needed at all, as the requirement is to abort the Job Sequence when the Job produces warnings.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Good Lord. Re-read my post, which is a simple and complete solution. You've made it unnecessarily complicated, given some incomplete information and need to understand that a Sequence must abort to be restartable.

ps. The Sequencer is needed unless you really want to hang all of that extra crap off your Job Activities. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

ray.wurlod,
ray.wurlod wrote:Then you must build this in - "automatic" handling only applies when a job (or other) activity actually fails - aborts
DataStage release 7.5 Developer's help wrote:Automatically handle job runs that fail.
Select this to have DataStage automatically handle failing jobs within a sequence (this means that you do not have to have a specific trigger for job failure). When you select this option, the following happens during job sequence compilation:

1. For each job activity that does not have specific trigger for error handling, code is inserted that branches to an error handling point.

2.A warning is logged in the sequence log about the job not finishing OK.

3. If the job sequence has an exception handler defined, the code will go to it.

4. If there is no exception handler, the sequence aborts with a suitable message.
I surmise that you missed to reason why this option should be built in here.

chulett,
Sorry, but that isn't true. Enable automatic handling and then include only an OK trigger to the next job - it will abort the Sequence for anything else, including warnings.
What ray.wurlod stated about automatic handling is absolutely true. But i still expect him to say why he has brought that option here.

What you stated after your comment on ray.wurlod statement does seem to be wrong. Because Job Sequence will not be aborted if the Job produces warning but aborted only when the Job is aborted if we enable automatic handling.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok, here's where I get to eat some crow, as they say. Nothing like sitting back, pondering for a moment and building tests jobs before posting absolutes. [sigh]

I didn't miss anything, Ram, I based everything I posted off of my 'standard' Sequence job design I've been using for a number of years. What I forgot in my late night / early morning weekend postings was a fundamental decision we made that allows this clean implementation - we do not allow jobs to end with warnings. They either run completely clean or abort, with nothing in-between. All or Nothing. This is what allows my design as posted to work.

You both are correct that 'failed' means 'aborted' in this context and that you need to build in extra crappola into your design if, indeed, one wants the Sequence to abort if jobs are allowed to finish with warnings. Still, I wouldn't use routine activities for this, that's far too Old School for me. What I would setup would still involve that trailing Sequencer so that each job has a full set up triggers associated with them, including the last one. In addition to the 'OK' trigger that passes execution on to the job step, I would use an 'Otherwise' trigger from each job that all go to a single Sequencer set to 'Any'. That sequencer would then lead to a Terminator which aborts the Sequence job and optionally sends stop requests to any currently running jobs as well. To me that would be a 'cleaner' design. YMMV.

ps. The 'Otherwise' trigger is a catch-all for all problems, including more than just 'Aborted'. If you've ever coded for an 'Aborted' job and then had it 'crash' you know what I mean. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

chulett wrote:Good Lord. Re-read my post, which is a simple and complete solution. You've made it unnecessarily complicated, given some incomplete information and need to understand that a Sequence must abort to be restartable.

ps. The Sequencer is needed unless you really want to hang all of that extra crap off your Job Activities. :?
I reread but no clue at last. And most importantly shall i know what information i have given is imcomplete?

All statements in the "For your information" section in my post is absolutely true and complete as the result of a smal experimention.

Your suggested solution does not seem to take of Job warning and corresponding Job Sequence abort - Observation from an experiment.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ag_ram wrote:Your suggested solution does not seem to take of Job warning and corresponding Job Sequence abort - Observation from an experiment.
Wait... which 'suggested solution'? :?

Both are equally valid, the first as long as you understand my posted caveat re: warnings while the second stands on its own regardless.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

OK chulett, but a clarification is now needed. Please...
chulett wrote:What I would setup would still involve that trailing Sequencer so that each job has a full set up triggers associated with them, including the last one. In addition to the 'OK' trigger that passes execution on to the job step, I would use an 'Otherwise' trigger from each job that all go to a single Sequencer set to 'Any'. That sequencer would then lead to a Terminator which aborts the Sequence job and optionally sends stop requests to any currently running jobs as well. To me that would be a 'cleaner' design. YMMV.
1. Where is the restartability here?

2. Did you consider this - 'Otherwise' trigger from each job may be pulled by the Job which is aborted without producing any warning(s)?

And i believe that the solutions we provided are not meeting the requirement because the Job Sequence does highly require restartabilty.

Any other solutions?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I stand by my solution and claim that no "other" solution is required to meet the need described in pat_raman2000's two posts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ray.wurlod wrote:I stand by my solution and claim that no "other" solution is required to meet the need described in pat_raman2000's two posts.
Of course. However, like most of the time, there's more than one way to skin this cat. All I was attempting to point out was that (in my opinion) the focus on just warnings was too narrow, but that rather you should handle all outcomes outside of the 'OK' box. Anything other than an 'OK', be it warnings, aborts, crashes or solar flares should result in the Sequence winding up in an 'Aborted/Restartable' status. The Otherwise / Terminator combo does just that with a minimum of fuss with a checkpoint enabled Sequence.

As to our new friend Ram...

1. It's all there, not sure what makes you think anything is missing. Why not build what I suggested and verify for yourself that it does indeed restart when appropriate.

2. Of course, by definition it covers all situations not otherwise covered by the existent triggers. Your 'abort with no warnings' scenario is... odd. The goal here is a Sequence which is restartable when there is any kind of problem. As Ray noted, there is no need for any other solutions as solutions have been given. You just parroted what Ray said and drew some lovely ascii art. After retracting the first "that isn't true" misstep on my part, I posted an alternative. Both satisfy the requirement.

:idea: Here's a thought. Rather than us continue to litter a perfectly good thread with our babblings, why don't we wait for Pat to come back and see what he thinks of the solutions posted? After all, he's the one that needs and will be supporting whatever methodology he derives from all this.

Me, I'm done with this unless Pat has more questions that I think I can answer without disgracing myself again. :roll:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ag_ram
Premium Member
Premium Member
Posts: 524
Joined: Wed Feb 28, 2007 3:51 am

Post by ag_ram »

ray.wurlod wrote: I stand by my solution and claim that no "other" solution is required to meet the need described in pat_raman2000's two posts.

ray.wurlod

You may. But, your solution does not face the requirement clearly. Please look at his requirement for a while.
pat_raman2000 wrote: My requirement is when it encounters warning it should abort and be there at Job1
Your solution does NOT guarantee the restartability of the Job Sequence when it encounters a warning which the Job produces.
Post Reply