Page 1 of 1

Calling a routine in a seqencer

Posted: Wed Jan 24, 2007 12:12 pm
by Christina
Hi,
i am calling a routine in a routineactivity in a sequence. When i checked the routine seperatly it is returning a correct value. but in sequence it is giving an error as

Routine DSU.GetSrtdtCount did not finish OK, return code = '2004-09-01/24'

The expected result is 2004-09-01 and it is coming correctly.

i am calling a sql file in my routine and i am giving the following along with the path and parameters.

Call DSExecute( 'UNIX', InputArg3, OsOutput, OsRetCode )
Ans=EReplace(OsOutput[552,10],@FM,"")

Posted: Wed Jan 24, 2007 12:16 pm
by chulett
Been discussed quite a bit here. Routines that do not return a zero are considered to have failed if you have the 'Automatically handle activities that fail' option enabled.

A search should turn up alot of information, so no need to retype it all here. :wink:

Posted: Wed Jan 24, 2007 12:17 pm
by Christina
The result is coming in 561 chars in which i need the last 13 chars so i am giving the following

Ans=EReplace(OsOutput[552,13],@FM,"")

Posted: Wed Jan 24, 2007 12:18 pm
by chulett
That's fine... but doesn't change my answer or what you'd need to do to handle the situation in the Sequence job. Search.

Posted: Wed Jan 24, 2007 12:25 pm
by I_Server_Whale
chulett wrote:Routines that do not return a zero are considered to have failed if you have the 'Automatically handle activities that fail' option enabled.
That explains a lot.

Posted: Wed Jan 24, 2007 12:25 pm
by velagapudi_k
What craig is telling to do is disable both the options
1)Automatically Handle Activities that fail
2)Log warnings with activities that finish other than OK
in your job properties, if you have enabled check point restartabilty.
Your routine is returning a value which is other than ok (date in your case)
so disable 2 and you should be fine.

Posted: Wed Jan 24, 2007 1:30 pm
by chulett
Actually, I didn't tell them to anything in particular other than search. :wink:

That is certainly one option but not the only option. The documentation explains how to use proper triggers so the job thinks you are handling any failures and will not try to be 'helpful' and handle the alleged failure for you.

Posted: Tue May 08, 2007 2:27 pm
by michaeld
I just use the User Variables Activity instead of the Routine activity. I call the routine in the User Variables Activity. This way I can call many routines in the same stage and I don't need to deal with that disable auto-handle errors bull sh**... since I need that feature on for other reasons and I don't want to define every single trigger...sorry sometimes datastage can be frustrating.

anyway, I hope that helps.

Posted: Tue May 08, 2007 2:58 pm
by mystuff
or you can create a function