EXCEPTION HANDLER not working.

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
soumik
Participant
Posts: 33
Joined: Fri Nov 17, 2006 12:20 am

EXCEPTION HANDLER not working.

Post by soumik »

Hi All,

I have a scenerio like this:

A SEQUENCE S1 having:

JOB-ACTIVITY(JA1) calls a job J1. If the Job J1 runs with status "FINISHED" or "FINISHED WITH WARNINGS" then it should go the next JOB-ACTIVITY(JA2) which calls job J2.

If the Job J1 is ABORTED then it goes to the EXCEPTION HANDLER which sends a mail of the problem.


I have designed the Sequence as shown below:
Trigger(OK)
JA1 -----------------------------------> SEQUENCER------------>JA2
Trigger(RUN WITH WARNINGS)
-----------------------------------> (ANY)



EXCEPTION HANDLER---------> MAIL NOTIFICATION




But the problem is when J1 job(which is called from JA1) is aborted then the control does not go to the EXCEPTION HANDLER and no mail is being sent.

Please help me out in this regard.
[/img]
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Hi,

There are 2 options

1) You need to check Automatically handle job runs that fail in job properties of sequnce to go to exception handler on job failures.

2) There is routine UtilityAbortToLog() use that, Link failure link from job activity to routine.
Like Link.Failure--->Email--->UtilityAbortToLog()

________
Anupam
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post by BalageBaju »

Hi,

Check whether the option, "Automatically handle activities that fail" is selected or not in Job Properties. If not check the option and try it.
Regards,
Balaji.
soumik
Participant
Posts: 33
Joined: Fri Nov 17, 2006 12:20 am

Post by soumik »

Thanks BalageBaju and Anupam for your reply.

Unfortunately We are using DataStage 6.0.1 r4 server edition and there is no licence for the parallel jobs.

So I am not able to get the option:"Automatically handle activities that fail" to check it. I know this is avaliable in parallel extender version.

I saw in the help file of datastage and found the following:

This routine takes a user defined message and displays it in the log as a fatal error message.

The routine should not be used in production. It should be used as a means to stop processing in job development, based on error conditions such as a threshold violation.



As these jobs needs to be promoted to PRODUCTION once I finish them in the DEV environment. Will it be a performance issue if I use this routine? Please suggest.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Pay attention to the version of DataStage in the post, peoples. Version 6.x didn't have any kind of check-pointing or the ability to 'automatically handle' much of anything. The OP will need to upgrade to get anything like that in their life. Also note that it's not a 'parallel extender version' issue, it is a 'I really need to upgrade' issue. :wink:

Read the Help on the Exception Handler - it is working just fine. Your problem is you are expecting 7.x behaviour from a 6.x stage and the way that stage works was majorly upgraded in 7.x. In your version it will only kick in if there is a problem with the Sequence itself (job doesn't exist, parameter can't be set, etc), not for any job failures.

You need to fall back on what has lovingly been referred to as the 'spider on crack' solution. Each stage will need a Failure link running to a Sequencer set to Any - and from there you can send an email and then shutdown the sequence via the routines you didn't actually name - UtilityAbortToLog or UtilityWarnToLog. In your version there's no need to actually abort anything. And only log a warning in a 'sub-sequence' so the higher level sequence knows Something Went Wrong. Otherwise, just end the Sequence.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply