I tried to use the transform 'NullToZero' in a controlling job and declared it like this (also tried some other ways):
Deffun NullToZero(A1) Calling "DSX.NULLTOZERO"
Is it possible at all to call transforms? Thanks in advance for any help!
Call Transforms in a controlling job
Moderators: chulett, rschirm, roy
Call Transforms in a controlling job
Kind Regards
Stephan
Stephan
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It is not possible to call a Transform from any kind of routine, including a job control routine.
If you use a Transform in a server job (Transformer stage) and examine the code generated by compiling that job, you will see that the Transform is replaced by its defining expression.
In effect, at compile time, the Transform is a compiler instruction to insert the defining expression at that location in the code.
If you want to mimic the effect of a Transform, you can use "literal EQUATE", which you will find in the BASIC manual. However, there is no capability to use placeholder tokens; in a literal EQUATE the definition is substituted literally.
If you use a Transform in a server job (Transformer stage) and examine the code generated by compiling that job, you will see that the Transform is replaced by its defining expression.
In effect, at compile time, the Transform is a compiler instruction to insert the defining expression at that location in the code.
If you want to mimic the effect of a Transform, you can use "literal EQUATE", which you will find in the BASIC manual. However, there is no capability to use placeholder tokens; in a literal EQUATE the definition is substituted literally.
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.
Could you also not drill back to the underlying Routine (if there is one) and call that instead in the same manner the Transform does? Or just use the Transform expression directly in one's code instead of attempting to call it?ray.wurlod wrote:If you want to mimic the effect of a Transform, you can use "literal EQUATE", which you will find in the BASIC manual. However, there is no capability to use placeholder tokens; in a literal EQUATE the definition is substituted literally.
-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:
Not every Transform invokes a Routine. Certainly you can call Routines from other Routines (probably needing a DEFFUN declaration).
However, if the Transform is simply an encapsulated expression, the answer is definitely no.
And using the Transform's defining expression in your code means that there's now two places where it has to be maintained, which is what I think the OP was trying to avoid.
Consider, for example, all the sdk Transforms that multiply by a constant, for example pints to litres (which I am reliably informed was the most thoroughly tested by the development team ). The value in these Transforms is that you don't have to remember/research the conversion constants, thereby enhancing your productivity as a developer.
However, if the Transform is simply an encapsulated expression, the answer is definitely no.
And using the Transform's defining expression in your code means that there's now two places where it has to be maintained, which is what I think the OP was trying to avoid.
Consider, for example, all the sdk Transforms that multiply by a constant, for example pints to litres (which I am reliably informed was the most thoroughly tested by the development team ). The value in these Transforms is that you don't have to remember/research the conversion constants, thereby enhancing your productivity as a developer.
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.