Page 1 of 1

Stage variables

Posted: Thu Mar 09, 2006 3:22 am
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

Posted: Thu Mar 09, 2006 3:24 am
by balajisr
It is not possible to refer stage variable of a transformer in another transformer.

--Balaji S.R

Posted: Thu Mar 09, 2006 4:52 am
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.

Posted: Thu Mar 09, 2006 5:17 am
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.

Posted: Thu Mar 09, 2006 5:18 am
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

Posted: Thu Mar 09, 2006 6:39 am
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.

Posted: Thu Mar 09, 2006 10:57 am
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

Posted: Thu Mar 09, 2006 12:00 pm
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.