sequence job failure

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

deesh
Participant
Posts: 193
Joined: Mon Oct 08, 2007 2:57 am

sequence job failure

Post by deesh »

Hi,

in my sequencer i have 5 jobs, if my 4th job fails, after reset the job, sequencer should be rerun from 3rd job not from 4th job.

Please some one give an idea how to achieve this activity without using routine.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The normal functionality of restartable sequences does not let you do this, it stores the last successful stage and starts execution after that. You can read the status information ( using a routine ) and change the execution order using that information.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Don't reset. Reset will clear the checkpoints. If the sequence status is "Aborted / Restartable" simply re-start it.
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 »

You missed their issue, Ray. Job N fails and they want to restart from Job N-1, not N.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

I have seen a solution for this issue ...
1. While invoking the sequencer thru command-line, always pass reset parm. (dsjob run -mode RESET -wait <proj> <jobname> )
2. In first step of Sequencer, get last run's status (within past X hours).
3. If last run was aborted then depending on aborted subjob, pass control to required (N-1) subjob.

Needless to say, the DataStage canvas for Sequencer looks cluttered. Also if Operations Console is being used, then DSODB tables are quite helpful in finding out status of previous run.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The second half of my earlier post somehow did not make it onto the forum. In it was the advice to mark the third activity "do not checkpoint run".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

To be clear, by not check-pointing job 3, it means always run Job 3 during a restart, regardless of whether it was job 4, job 5 or any other downstream job that failed.

It does not mean "pick up" from Job 3 and continue.

For example, if Job 3 and 4 worked, and Job 5 failed, then the restarting the sequence would run Job 3, skip Job 4, and re-set and rerun Job 5.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm wondering is this is a generic question or a very specific one... as in are they asking about this specific job in this specific sequence specifically? Or is this meant to be more general where X fails and for some reason you'd want to start at X-1 generally.

:wink:
-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 »

I assumed that it was a specific question because of the lack of any "for example" or similar in the question.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

The best way to accomplish what you want is what we call touch files. So have a folder we put a sequential file in after each job runs successfully. Each file in a sequence is assigned a file. All files in a sequence start with the same name. All restartability is turned off. So if this file exists then do not run the job. The sequence does this check. If the file is not there then the job is ran.

Now you can manually or automatically delete any file to run all jobs or skip specific jobs.

Works great. Used it for years. You can script removing or adding these files as needed.
Mamu Kim
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

kduke wrote: All restartability is turned off.
Did you really mean to say "check-pointing" is turned off? Surely you'd still want the jobs all configured to re-set and re-run?
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

That is part of what I meant Andy. Check-pointing plus automatic handling and the job property settings need to be set properly so DataStage does not handle where to start next run. All that is handled by files. One file per job. You can create these in the sequence after a job runs successfully with an echo command or a touch command. We used to call them touch files for that reason.

The checkpoints try to control which job starts after a failed run. You need to turn all that logic off.

This helps other things work better as well. If you have steps in a sequence which calculate variables then these steps get skipped with restart and checkpoints set. These can always run if checkpointing and DataStage restartability is turned off. Makes life easier. Restarting a job the old way when it fails more than once was always a risk. Never seemed to work correctly.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Kim, how does the "touch file" approach work if the job activity failure is at, say, the fourth iteration of a loop?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Does not work within loops.
Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

FYI the checkpoint mechanism does work within loops.
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