How to reset the job if any job fails in project ?

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
vasam
Participant
Posts: 30
Joined: Wed Nov 04, 2009 5:06 am

How to reset the job if any job fails in project ?

Post by vasam »

Hi All,

I have a requirement like i want to reset the job if any job fails during the execution(system crash etc) in entire project?

my reqirement is

if any distaer happens my jobs are in abort status, so i want to reset all the jobs at a time?

Any idea?

thanks,
Vijay
vijayakumargoud
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

While not trivial, it is not difficult to implement. I would write a job sequence or shell script that retrieves the list of all jobs in project (using DSGetProjectInfo() or a dsjob call) and then, for each job, check the status and issue a reset call if that job state is aborted.
vasam
Participant
Posts: 30
Joined: Wed Nov 04, 2009 5:06 am

Post by vasam »

Thanks for ur reply,

can you please provide code if you have, that would be very helpful for me.

Thanks,
Vijay
vijayakumargoud
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

You can set this at the sequencer as well. There is a option 'Reset job if required'.
Regarding code - i.e invoking from a sheell - you need to go through the documentation and try out.

Regards
Sreeni
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

Each Job Activity stage in sequence has a Execution Mode.
You can set it to "Reset if required, then run".
This will take care in any job fails
Regards
LakshmiNarayanan
thanush9sep
Premium Member
Premium Member
Posts: 54
Joined: Thu Oct 18, 2007 4:20 am
Location: Chennai

Post by thanush9sep »

Oops sorry one sec late....... :D
Regards
LakshmiNarayanan
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Which doesn't help the Sequence job itself or anything not run under the control of a Sequence for that matter. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
vasam
Participant
Posts: 30
Joined: Wed Nov 04, 2009 5:06 am

Post by vasam »

Thanks for your reply,

Actually my req is i am not going to touch any job in the projects, what ever jobs available in particular project which are abot staus i want to Reset the job. I may use this job different project also.

Thanks,
Vijay
vijayakumargoud
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Okay... go ahead. Arnd has given you the solution, however the coding is all on you I'll wager. You can use dsjob for all of this, btw, if you'd rather script this than write a job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Give it a go - either through BASIC code or through scripting with dsjob and if you get stuck post your question to this thread. The general concensus here is that everyone is willing to supply assistance when people get stuck, but providing complete solutions is what many here get paid to do in our "real lifes" so it is unlikely that we'll do it here for free.

The corollary to the comments above which I use as my "acid test" of whether or not to respond is that if a poster hasn't put any effort into looking for a solution then I won't, either.

Back to the original question: there are 2 paths mentioned, so give one a try and post back here if you get stuck or have questions. But don't expect a complete solution to this non-trivial question.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post by laknar »

First list the jobs using dsjob -ljobs projectname and write into file.

And then pass the jobnames using for loop

dsjob -jobstatus projectname jobname

Grep the status which ever you are looking for and reset it by using

dsjob -run -mode reset projectname jobname.
Regards
LakNar
Post Reply