Calling a routine in a seqencer

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
Christina
Participant
Posts: 34
Joined: Wed Sep 06, 2006 11:50 am

Calling a routine in a seqencer

Post 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,"")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Christina
Participant
Posts: 34
Joined: Wed Sep 06, 2006 11:50 am

Post 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,"")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post 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.
Last edited by I_Server_Whale on Wed Jan 24, 2007 12:26 pm, edited 1 time in total.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
velagapudi_k
Premium Member
Premium Member
Posts: 142
Joined: Mon Jun 27, 2005 5:31 pm
Location: Atlanta GA

Post 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.
Venkat Velagapudi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
michaeld
Premium Member
Premium Member
Posts: 88
Joined: Tue Apr 04, 2006 8:42 am
Location: Toronto, Canada

Post 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.
Mike
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

or you can create a function
Post Reply