Sequence Goes To Exception Handler

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
bi_fujitsu
Premium Member
Premium Member
Posts: 46
Joined: Tue Mar 20, 2007 3:30 am
Location: India

Sequence Goes To Exception Handler

Post by bi_fujitsu »

Hi

I have a sequence with the following flow.

Routine1 ------>JobA----------->JobB---------->Routine2

Exception_Handler---------->Email------------>Terminator

Routine 1 Returns a value which is something like 20070303#15:45#0 or
20070303#15:45#1. In the Trigger option of the routine i am saying that JobA should get executed only if
Convert(@FM,"",(Field(Routine1.$ReturnValue,"#",3))) = '0'

I can see that my routine is retuning a value of '0' but even then instead of going to Job A it goes to Exception Handler.

The problem seems to me is that the sequence is not able to read that Convert(@FM,"",(Field(Routine1.$ReturnValue,"#",3))) is returning me '0'.

Can you please help me in resolving this issue.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Can you please post the logs of this sequence.

It seems like the return value is causing the problem but will only be clear when you post the logs (better is you post detailed logs)
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Been discussed here many times, routines that do not return a zero are considered to have failed if the 'Automatically handle' option is ticked and you don't have the proper triggers set up from the Routine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
bi_fujitsu
Premium Member
Premium Member
Posts: 46
Joined: Tue Mar 20, 2007 3:30 am
Location: India

Post by bi_fujitsu »

Hi

I did the following activities to get this working after going through the various posts.
!!!!!!!!Thanks a lot for all your Timely Support in resolving this problem well in time.

When we use Routines in our Sequence and if we are triggering any further Activities then the Return Value of a successful Routine should always be 0. If we are assigining a user defined value to a routine which is used as a parameter value for other Activity Stages in the Sequence then that Routine should be executed from the User Variable Activity Stage and the output of the routine should be assigned to a user defined variable.

If we don't do this then the Exception handler will always treat that routine as a failure if the Return Value is other than 0.

If we are triggering two different set of jobs based on the output value of the Routine then we need to use the Nested Condition Stage after the User Variable Activity Stage and there we can define our condition for executing the jobs.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's certainly one way to solve the problem. Another is to use the technique described in the online help - use two triggers from the routine, typically an OK and an Otherwise, both sent to a Sequencer set to 'Any' before moving on to the next stage in the flow. The code generator notices that you are explicitly handling any 'failures' with these triggers, so the 'automatically handle' option is not triggered.

The key is noting that the error message logged is about an 'unhandled exception'... and the solution is to handle any 'exceptions' of this nature yourself.
-craig

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