Exception in Exception handle

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

Moderators: chulett, rschirm, roy

Post Reply
bondlee
Participant
Posts: 7
Joined: Tue Jan 11, 2011 11:15 pm

Exception in Exception handle

Post by bondlee »

Hi,

I have spotted a strange, but not impossible, scenario in a job sequence that has a user defined exception handler.

When an exception occurs in a job sequence, the code under exception handler gets executed. But the interesting thing to know is what happens when the code under that ex handler encounters another exception...? The sequence gets aborted irrespective of Terminator stage usage in ex handle.

Any one has an idea to prevent the sequence from aborting when such scenario occurs?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Prevention is always better than cure. Don't write them that way. What kind of activity under the "exception being handled" stream is aborting?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bondlee
Participant
Posts: 7
Joined: Tue Jan 11, 2011 11:15 pm

Post by bondlee »

Hi Ray,

If it is something that I can control, that would have been my first choice. To give more details, there is a job that is being called under ex handle stream. If that job is not in runnable state or if one of its parameters can't be set, that results in exception under the ex handle stream. Logically the same reason would have raised the first exception as the same job would have been part of main stream too.

In my case, there is a parameter that needs to be generated before it is passed to a job and if it can't be generated, that would raise exceptions wherever it is expected including ex handler.

Thus I didn't see any way out here to prevent abortion. So thought of giving a try with rest of the world.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

There is probably two things happening here. Did you check automatically handle exceptions in job properties? This will force aborts on jobs aborting. Did you check the job restartability? This will skip successful steps when rerunning. This means the step where you calculated the job parameter value may get skipped when rerunning.
Mamu Kim
bondlee
Participant
Posts: 7
Joined: Tue Jan 11, 2011 11:15 pm

Post by bondlee »

I did un-check the 'automatically handle exceptions'. No problems with restartability.
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

The product is designed that way to keep an infinite loop from occurring when the exception handler code generates an exception.

As said earlier, that's why you make very sure the exception handler code is minimal and very clean. I typically don't run ANY jobs in my exception handlers. I just send email and stop.
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
bondlee
Participant
Posts: 7
Joined: Tue Jan 11, 2011 11:15 pm

Post by bondlee »

Thanks for the reply. I did think the same but just wanted to see if I was missing any possible setting to make the sequence end gracefully rather than abort. That is a master sequence with no parent and needs manual intervention to reset.

Anyway, thanks for your interest.
Post Reply