Is there any way where I can pass stage variable(transformer stage) to another stage in same job?
Incidence in my job:
I have to read a typical mainframe file having header, detail and trailer. In trailer there is count of detail records specific. My job needs to verify actual count of records with count provided in trailer.
I am counting total detail records in aggregator. Another stage uses column Import stage to get the count from trailer in a transformer stage.
Now I want to check both counts and abort job if they do not match?
Any Idea on how this can be done.
Also another requirement is I need to write message saying " Trailer records Msmatch" in Datastage joblog before aborting the job.
Thanks in advance,
Santosh
reading stage variable in another stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Add an extra column to the output link of the Transformer stage. The derivation for this column is the value of the stage variable. This remains available in downstream stages as far as you want to propagate it.
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.
Re: reading stage variable in another stage
You can't. Stage variable stays in the Stage.
Ray's method is a good way. You can concatenate (with ":") any other value to it and propogate it downstream too.
- Sachin
Ray's method is a good way. You can concatenate (with ":") any other value to it and propogate it downstream too.
- Sachin
Re: reading stage variable in another stage
Thanks Ray , Sachin:sachinkc wrote:You can't. Stage variable stays in the Stage.
Ray's method is a good way. You can concatenate (with ":") any other value to it and propogate it downstream too.
- Sachin
I was trying to assign a job variable in transformerA and use it in another transformerB which is not downstream to this stage. But I am sure that transformer B will run after transformerA and I would access job varible to take decesion in transformerB.
Can I assign job variable in stage. Or any other way I can achieve above functionality?
regards,
Santosh
Re: reading stage variable in another stage
Store the o/p of xfmA in some temp file (which includes the value of xfmA Stage var), read it along with xfmA Stage var in xfmB.
- Sachin
- Sachin
santosh wrote:
Thanks Ray , Sachin:
I was trying to assign a job variable in transformerA and use it in another transformerB which is not downstream to this stage. But I am sure that transformer B will run after transformerA and I would access job varible to take decesion in transformerB.
Can I assign job variable in stage. Or any other way I can achieve above functionality?
regards,
Santosh
Re: reading stage variable in another stage
Thanks Sachin,
sachinkc wrote:Store the o/p of xfmA in some temp file (which includes the value of xfmA Stage var), read it along with xfmA Stage var in xfmB.
- Sachin
santosh wrote:
Thanks Ray , Sachin:
I was trying to assign a job variable in transformerA and use it in another transformerB which is not downstream to this stage. But I am sure that transformer B will run after transformerA and I would access job varible to take decesion in transformerB.
Can I assign job variable in stage. Or any other way I can achieve above functionality?
regards,
Santosh
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You could also store the value in the job's user status area, and retrieve it from there in TransformerB.
However, under the covers this does a write to disk anyway, so there's no gain (and there is some pain) in using this method.
However, under the covers this does a write to disk anyway, so there's no gain (and there is some pain) in using this method.
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.