Controller problem: Unhandled failure (2)encountered calling

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
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

Controller problem: Unhandled failure (2)encountered calling

Post by harryhome »

Hi

We have a sequence of which the execution flow as follows,

At the first job we are taking out some rows from database and putting into hash file / Seq file.

now the if no. of rows = 0 , sequence should be stop executin after this job else sequence should executed

I have designed the sequence as below.


In the job activity I have called the first jo where I am taking the row-counts of the file, Then I have defined a routine which is counting the number of rows getting written to the link.

Routine takes three arguments (JobName,StageName,LinkName) and gives the count.

This count value I am capturing in to the activity variable and defining the "Custom-Conditional" Trigger, if the count value is more than 0 then execute the Sequence else Terminate the Sequence.

This design is working fine when the number of records are 0 at first job ,but when records are more than zero the routine is giving warnings saying as

"REQ_Delete_Seq_Terminator..JobControl (@count_check): Routine DSU.countcheck did not finish OK, return code = '2'
"REQ_Delete_Seq_Terminator..JobControl (@count_check): Controller problem: Unhandled failure (2) encountered calling routine DSU.countcheck"


For terminate the Sequence I am using terminator stage,but drawback of this stage is that it is aboarting the sequence but we don't want the abort we want that the sequence should come out of execution flow without abortion.



Plz guide on same
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It looks like you have declared and called "countcheck" as a before/after subroutine. According to the docs, any non-zero return value is construed as a failed call and triggers an error. You will need to call this as a normal routine in order to work as you've designed the process flow.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nah... it's the standard 'problem' with any routine that returns a non-zero result and the 'Automatically handle activities that fail' option in a Sequence job. :wink:

Discussed here a bajillion times and documented in the online help. You need to use two triggers so that the Sequence job thinks you have handled the failure so it doesn't need to. For example:

1) Use an OK (Conditional) trigger to catch the zero result. Link it to a Sequencer so the flow just stops.

2) Use an Otherwise trigger to continue the job flow when the return value is non-zero.

That's one way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

chulett wrote:Nah... it's the standard 'problem'...
I should have read the whole post.
Post Reply