Exception Handler Issue

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
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Exception Handler Issue

Post by sjhouse »

I'm having a problem with my error handling within a sequencer. I've done the following steps.

- Checked the box in the job properties to to 'Automatically handle job runs that fail'.
- Setup an exception handler to log an entry in director and to link to a notification stage to send an appropriate email message.
- 4 jobs that execute sequentially with the trigger set to OK.

My understanding according to documentation is that any job finishing with a status other than '1' (Finished OK) will go through the exception handler. In my sequencer, Job 3 finished with a status of '2' (Finished with warnings).

In Director, the sequencer generates a warning message for the job that completed with warnings. Then it finishes with 5 messages (Report on job, Checkpointed run of job, removed checkpoint at successful completion of sequence, summary of sequence, finished job). It does not go to the exception handler. no email is sent, and the sjob status of 'Finished (see log)' even though job 4 was never executed.

Is there something I am missing in my job or project configuration?

Any help is appreciated.

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

Post by ray.wurlod »

Status 2 (finished (see log)) is not counted as a failure. It is not handled by the Exception Handler.
Therefore you need to code your own design. What do you want to do in these cases?
One suggestion is to set up each Job Activity with multiple Triggers. OK and Warning go through an Any sequencer and on to the next step. Warning could run through a Routine Activity calling UtilityWarnToLog before reaching the sequencer.

Code: Select all

                        (OK)
     -----> Job  ------------------------>  Any  ----->
             |                               ^
             | (Warning)                     |
             |                               |
             +---------->  Routine  ---------+
Another output link from the Job Activity could then carry the Otherwise trigger, and you treat this in the same way as you currently treat your Exception Handler. Note that, if an aborted job is handled by its activity, it is not trapped by the Exception Handler.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Post by sjhouse »

Thank-you Ray,

The documentation is vague and states any jobthat returns any value other than 0 to indicate success will always be taken as indicating failure.

I made the assumption that this was talking about the job status :oops: We've been doing the job ok link and otherwise link and they have become very cluttered. I saw this added functionality of the exception handler as a way to streamline some of the job sequences.

We'll have to handle jobs finishing with warnings differently.

Stephen
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
that is mentioned in the docs regarding routines not jobs
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
elavenil
Premium Member
Premium Member
Posts: 467
Joined: Thu Jan 31, 2002 10:20 pm
Location: Singapore

Post by elavenil »

Hi Stephen,

From the job activity, one more link can be created in the job sequencer for Finished with Warnings and this link can be joined to the exception handler activity so Exception handler activity will get executed if the job failed or finished with warnings.


Job Activity --> Success --> Next Job Activity
|
|--->Failed/Finished with Warnings-->Exception Handler

This way you could call your exception handler when the job failed or finished with warnings.

Regards
Saravanan
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Post by sjhouse »

Saravanan,

The Exception Handler does not accept Input links and we are trying to eliminate all of the extra links we've had in the Job Sequencers.

I have asked a fundamental question to those in charge:

:?: Why the jobs in production run with the default of 'abort job after 50 warnings' when most of them are set up to go to error processing for anything without a job status of 'OK'?

We could set the default to 'Abort job after 1 warning' and address the few jobs that allow warnings separately. That way we could streamline the jobs and use the Exception handler.

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

Post by ray.wurlod »

The default of 50 can be changed in Director. Choose Tools > Options. Find Limits.
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 »

That is a worthless design. It should trap all the untrapped statuses. I thought it worked that way in older versions of DataStage. If you have to trap with an otherwise trigger then it clutters up the design. If you have an otherwise trigger then why would need an exception handler?
Mamu Kim
Post Reply