Value from routine in routine activity
Moderators: chulett, rschirm, roy
Value from routine in routine activity
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
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.
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.
Arnab
Re: Use Ans
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.
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
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.
Also check the triggerring.
Arnab
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
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 :wink:](./images/smilies/icon_wink.gif)
If there's something wrong with your routine code, post it, we'll get it squared away.
![Wink :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers