Page 1 of 1

Exception Handler Issue

Posted: Fri Jun 03, 2005 7:16 am
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

Posted: Fri Jun 03, 2005 5:14 pm
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.

Posted: Mon Jun 06, 2005 6:29 am
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

Posted: Mon Jun 06, 2005 6:48 am
by roy
Hi,
that is mentioned in the docs regarding routines not jobs

Posted: Mon Jun 06, 2005 9:57 am
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

Posted: Mon Jun 06, 2005 10:14 am
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

Posted: Mon Jun 06, 2005 3:07 pm
by ray.wurlod
The default of 50 can be changed in Director. Choose Tools > Options. Find Limits.

Posted: Tue Mar 26, 2013 7:13 am
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?