Call Transforms in a controlling job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
spracht
Participant
Posts: 105
Joined: Tue Apr 15, 2003 11:30 pm
Location: Germany

Call Transforms in a controlling job

Post by spracht »

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!
Kind Regards
Stephan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It is not possible to call a Transform from any kind of routine, including a job control routine. :cry:

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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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.
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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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 :lol: ). 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.
Post Reply