Resetting an aborted 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
swwilbert
Participant
Posts: 6
Joined: Wed Mar 07, 2007 1:37 pm
Location: Cincinnati

Resetting an aborted sequence

Post by swwilbert »

I have a multi-job setup in which a "Main" sequence calls a "Sub" sequence, which runs actual processes. If a process fails, the "Sub" sequence aborts and the "Main" sequence aborts. I have an Execution Action on all sequences, "Reset if required, then run", which will reset and run the "Sub" sequence and actual process using the "Main" sequence, but only after I have manually reset the "Main" sequence.

How can I dynamically reset the "Main" sequence, which is a scheduled job to avoid manual intervention? Any thoughts?

Thanks in advance
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

An aborted Master Sequence job cannot be reset without manual intervention. Whenever a Master sequence job aborts, it requires attention to fix whatever went wrong and then restart it from where it failed or manually reset it and then start again.

HTH
Kris
Kris

Where's the "Any" key?-Homer Simpson
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Resetting an aborted sequence

Post by gateleys »

Welcome to DSXchange.

The idea is to have your main sequence such that it does not abort under normal circumstances. I, normally, wrapper my MAIN sequence in another sequence .... let's call it the INIT sequence. The INIT sequence calls the MAIN sequence (which is set to 'Reset and Run if Required). However, failure of MAIN is NOT propagated to INIT. This way, INIT will always finish OK.

gateleys
mctny
Charter Member
Charter Member
Posts: 166
Joined: Thu Feb 02, 2006 6:55 am

Re: Resetting an aborted sequence

Post by mctny »

I think you can call your main sequence in a unix script but you have to write one or find one written, I am not that expert in writing a script to run a datastage job but it is not that hard. search the forum or internet. The idea is to just call the main sequence in a loop that try to run it as many times as long as it aborts , quit the loop if the main sequence completed OK or that many number of trials have been reached ( 3, 5). you need to capture the status of the main sequence to decide if you need to try to run again ( ofcourse you need to reset the sequence automatically in the loop as well) or quit the loop.

Maybe some people in this forum can provide you a sample script so that you can use it. I hope it helps.
Thanks,
Chad
__________________________________________________________________
"There are three kinds of people in this world; Ones who know how to count and the others who don't know how to count !"
swwilbert
Participant
Posts: 6
Joined: Wed Mar 07, 2007 1:37 pm
Location: Cincinnati

Reply

Post by swwilbert »

It seems how ever I wrap it, all the sequences seem to abort or maybe I'm not calling it correctly. How can the INIT sequence not be affected by the sequence it is calling?

I have tested the below code, set in a "control" job, that can be run before the "Main_Sequence" is scheduled, which will reset just the "Main" sequence and all jobs attached will automatically run. I was trying to avoid that if at all possible.



* DEFINE FIRST SEQ - RESET SEQ
hJob1 = DSAttachJob("MAIN_SEQUENCE", DSJ.ERRFATAL)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
Call DSLogInfo("JOB STATUS ":Status, msgs)
If Status = 21 or Status = 99 then
End Else
ErrCode = DSSetDisableProjectHandler(hJob1, @FALSE)
ErrCode = DSSetDisableJobHandler(hJob1, @FALSE)
ErrCode = DSRunJob(hJob1, DSJ.RUNRESET)
ErrCode = DSWaitForJob(hJob1)
Status = DSGetJobInfo(hJob1, DSJ.JOBSTATUS)
End
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Reply

Post by gateleys »

swwilbert wrote:How can the INIT sequence not be affected by the sequence it is calling?
You can test what I had suggested.
1. Create a sequence job with any 1 or 2 jobs. Call this sequence MAINseq.
2. Create another sequence job called INITseq which contains only MAINseq. Do not embed any logic in this (INITseq) to abort the sequence in the event of any failures.
3. Introduce some error in any of your job in MAINseq to test if INITseq will also fails.
4. Run INITseq. Let me know what happens.

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

Post by ray.wurlod »

In INIT, do not check the "log warning if finished other than OK".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
swwilbert
Participant
Posts: 6
Joined: Wed Mar 07, 2007 1:37 pm
Location: Cincinnati

Post by swwilbert »

I still need to test all the possibilities, but what I have found is if the check box "Automatically Handle Activities that fail" is checked, the INIT Seq will abort, along with all the sub sequences. If it is unchecked, only the sub sequences abort and the INIT shows Finished. So to answer gateleys question, this will and does work as long as the INIT is unchecked.

Thanks for all the help.

Steve
Post Reply