Page 1 of 1

Value from routine in routine activity

Posted: Thu Jan 11, 2007 3:04 am
by ds_team
Inside jobsequence i have a routine activity which calls a routine. I want to set a value inside this routine and in the next nested conditional stage i want to get this value and do a comparison. How can I get the value outside the routine.setting userstatus dont work out here.Can i use return to set the value. If so please give me the format for this.

Use Ans

Posted: Thu Jan 11, 2007 3:14 am
by arnabdey
Hi

From the routine you can retrun a value by giving the following
Ans=..... at the end
The value is returned only if it is a transform type routine.
Now it's output trigger should be Unconditional.... [b]NOT[/b] Ok (Conditional). In any subsequent stages you can access the value by <Routine Stage Name>.$ReturnValue. You can get it from Activity Variable option in the Expression Editor.

Re: Use Ans

Posted: Thu Jan 11, 2007 3:26 am
by ds_team
What do you mean by transform type routine?

I did set ans=1 inside my routine. but i was not able to get this value outside.

arnabdey wrote:Hi

From the routine you can retrun a value by giving the following
Ans=..... at the end
The value is returned only if it is a transform type routine.
Now it's output trigger should be Unconditional.... NOT Ok (Conditional). In any subsequent stages you can access the value by <Routine Stage Name>.$ReturnValue. You can get it from Activity Variable option in the Expression Editor.

Hi

Posted: Thu Jan 11, 2007 3:44 am
by arnabdey
When you develop the routine you have a Type drop-down menu in General Tab. There you need to specify as Transform Function. So when you go to the Code page, at the botton you get Return (Ans). So at the end of your routine, if the Ans is set, that will be returned.

Also check the triggerring.

Posted: Thu Jan 11, 2007 3:58 am
by arnabdey
By the way it is not ans..... It is Ans.

Posted: Thu Jan 11, 2007 5:10 am
by ds_team
I did change the type of my routine to transform. But this routine doesnt serve my purpose. Is there any other way of doing this :(
arnabdey wrote:By the way it is not ans..... It is Ans.

Posted: Thu Jan 11, 2007 5:42 am
by arnabdey
Can you show me the code for the routine?

See you check the following

1. You should do
Ans=1 not ans=1

2. Check the trigger condition

Posted: Thu Jan 11, 2007 6:21 am
by ray.wurlod
In the downstream activity, click on the helper tool (which might be labelled something like Insert Job Parameter) or - if using the Expression Editor - choose Activity Variable. You will get a list of all activity variables from upstream activities, including your Routine activity's $ReturnValue, displayed in a list. Select it from that list.

Posted: Thu Jan 11, 2007 7:48 am
by DSguru2B
Excuse me for my ignorance, but why cant you utilize the user status area. Sequence jobs do have user status areas. Correct me if i am wrong.

Posted: Thu Jan 11, 2007 9:00 am
by chulett
Just to throw more chum in the water, there's no need for User Status or to check the returned value separately in a downstream activity. You can do it directly in the triggers from the Routine Activity stage as there is a trigger type specifically for checking Return values.

If there's something wrong with your routine code, post it, we'll get it squared away. :wink: