Stage variables

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
Umbix62
Participant
Posts: 79
Joined: Mon Jan 16, 2006 2:47 pm

Stage variables

Post by Umbix62 »

Hi there

Does anybody know if it is possible and how to reference to a stage variable created in a trasformer stage from another trasformer stage?

For example:

---Trasformer Stage "TStage1"
In this stage I createa Stage Variable "X"

-- Trasformer Stage "TStage2"
How can I reference the Stage Variable "X" defined in "TStag1", even if it is possible?

Thank you

Umberto
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

It is not possible to refer stage variable of a transformer in another transformer.

--Balaji S.R
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

As Balaji has already said, it is not possible; particularly when those transform stages are executed in separate processes. You should pass the data downstream by adding a column with the variable's value to the next transform.
Umbix62
Participant
Posts: 79
Joined: Mon Jan 16, 2006 2:47 pm

Post by Umbix62 »

ArndW wrote:As Balaji has already said, it is not possible; particularly when those transform stages are executed in separate processes. You should pass the data downstream by adding a column with the variable's value to the next transform.
I supposed that. Ok thank you for your answer.
Umbix62
Participant
Posts: 79
Joined: Mon Jan 16, 2006 2:47 pm

Post by Umbix62 »

balajisr wrote:It is not possible to refer stage variable of a transformer in another transformer.

--Balaji S.R
Ok, as i supposed it is not possible. Thank you very much

-- Umberto
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the second Transformer stage is downstream of the first, all you need to do is to add the stage variable as an extra output column on the output link from the first Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Umbix62
Participant
Posts: 79
Joined: Mon Jan 16, 2006 2:47 pm

Post by Umbix62 »

ray.wurlod wrote:If the second Transformer stage is downstream of the first, all you need to do is to add the stage variable as an extra output column on the output link from the first Transformer stage.
No, in my case the second Trasformer stage is not subsequently to the first. In anycase I have to do that for solve my problem. I've to add an output column and downstream it for all the stages interested.

Thank you for your help

Umberto
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Load the value in the job's user status area and retrieve it from there in the other Transformer stage. But there's only one user status area.
You can also use system variables @USER0 through @USER4 and @USER.RETURN.CODE to get five more. If you need more than six, you will need to pack them up into delimited strings, use the above methods, and unpack subsequently - using the Field() function.
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