Hi !
I need to run Transform from SDK Library of DS from my routine.
How I need to declare it in my routine?
Some examples ?
SDK Transform Calling
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 252
- Joined: Mon Sep 19, 2005 10:28 pm
- Location: Melbourne, Australia
- Contact:
The transform you want to use almost certainly references an SDK routine of the same name. So rather than referencing the transform from your routine, what you really want is probably to reference the underlying routine.
If I'm wrong and the transform you want is just a simple one-liner that doesnt reference a routine then I think you're out of luck. I've tried and failed too. I suspect that transforms may only be used from within transformer stages.
Back on track though... If I'm right and there is an underlying SDK routine, you need a declaration at the top of your routine. Here's an example I pinched from another thread in this forum:
DEFFUN OpenTextFile(Name, OpenMode, WriteMode, Logging) Calling "DSU.OpenTextFile"
If your SDK function is called BiteMe and takes 3 args, you could declare it as follows:
DEFFUN BiteMe(A,B,C) Calling "DSU.BiteMe"
The names of the parameters are not important - but they can give the future reader an insight into what the routine does with going and opening it.
If I'm wrong and the transform you want is just a simple one-liner that doesnt reference a routine then I think you're out of luck. I've tried and failed too. I suspect that transforms may only be used from within transformer stages.
Back on track though... If I'm right and there is an underlying SDK routine, you need a declaration at the top of your routine. Here's an example I pinched from another thread in this forum:
DEFFUN OpenTextFile(Name, OpenMode, WriteMode, Logging) Calling "DSU.OpenTextFile"
If your SDK function is called BiteMe and takes 3 args, you could declare it as follows:
DEFFUN BiteMe(A,B,C) Calling "DSU.BiteMe"
The names of the parameters are not important - but they can give the future reader an insight into what the routine does with going and opening it.
Ross Leishman
Your suspicions are correct. It's just a snippet of derivation code that's substituted in by the compiler at compile time.rleishman wrote:I suspect that transforms may only be used from within transformer stages.
Snassimr, open up the transform and use that snippet in your routine... follow the DEFFUN advice that rleishman outlined if it references a custom routine.
Last edited by chulett on Thu Sep 22, 2005 5:00 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Transforms are pre-stored expressions. They are not callable. If you use them in Transformer stages then inspect the generated code, you will see that they are replaced by their defining expression; that is, the expression becomes in-line code.
It follows that the response suggesting DEFFUN is way off the mark. Note, too, that SDK routines are not cataloged with a "DSU." prefix; most are cataloged with an all upper-case name that has a "DSX." prefix.
It's also unfortunate that DataStage terminology can be confusing; a Transform is different from a transform function (which is a Routine) and they're both different from a Transformer (which is a stage type).
It follows that the response suggesting DEFFUN is way off the mark. Note, too, that SDK routines are not cataloged with a "DSU." prefix; most are cataloged with an all upper-case name that has a "DSX." prefix.
It's also unfortunate that DataStage terminology can be confusing; a Transform is different from a transform function (which is a Routine) and they're both different from a Transformer (which is a stage type).
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.