Hi to all datastage gurus,
How do you call a routine within a routine in datastage? I am creating a custom routine and wants to use the UtilityHashLookup routine inside my custom routine.
I tried the syntax "Call DSX.UtilityHashLookup("HA_REC_TYPE","2000",2)" but when i compile it's telling me that the routine is expecting 4 arguments but it only has 3 arguments.
Is there any other way to call the subroutine?
calling routine within a routine
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 6
- Joined: Thu Jan 04, 2007 3:46 am
- Location: Malaysia
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
One of the strange things about functions in DataStage BASIC is that they can, indeed, be called as subroutines; the first argument position is reserved for the return value. Therefore the following are equivalent.
Code: Select all
Call DSX.UTILITYHASHLOOKUP(Result,"HA_REC_TYPE","2000",2)
Code: Select all
DEFFUN UtilityHashLookup(Arg1,Arg2,Arg3) Calling "DSX.UTILITYHASHLOOKUP"
Result = UtilityHashLookup("HA_REC_TYPE","2000",2)
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.
Hmm. I didnt know a subroutine could be called like that. Thanks for the info Ray.ray.wurlod wrote:Code: Select all
Call DSX.UTILITYHASHLOOKUP(Result,"HA_REC_TYPE","2000",2)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: