I have 2 source tables followed by Join stage(outer join),followed by Transformer stage which branches data into 4 output sequential files.
Now I want to calculate the total records coming into Transformer stage and write it to a sequential file.
I used a stage variable 'TotalCounts' in Transformer, set its initial value to 0 and in derivation 'TotalCounts + 1'
But when I am looking at the output the TotalCounts values written to the file gets recycled after some interval. Please suggest how it can be done.
Getting record count from Transformer
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
System variable @INROWNUM maintains the count of rows on the input link, while each output link maintains its own @OUTROWNUM (on each partition in each case). You could collect these into an extra two columns on each output link, and use downstream Copy stages to split them out, and Aggregator stages (perhaps in Sequential mode) to report the Max of each.
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: Getting record count from Transformer
have you tried DSGetLinkInfo (JobHandle, StageName, LinkName, InfoType)??aaikat wrote:I have 2 source tables followed by Join stage(outer join),followed by Transformer stage which branches data into 4 output sequential files.
Now I want to calculate the total records coming into Transformer stage and write it to a sequential file.
I used a stage variable 'TotalCounts' in Transformer, set its initial value to 0 and in derivation 'TotalCounts + 1'
But when I am looking at the output the TotalCounts values written to the file gets recycled after some interval. Please suggest how it can be done.