hi to all
can anyone tell me how can i count number of records in source(flat file)
Thanks in advance
cheers.....
raju
number of records in source
Moderators: chulett, rschirm, roy
Pass source data through a transformer, pass one column from source link, and pass one more column within the transformer (mark it as key) to the output link from the transformer.
Provide derivation as @OUTROWNUM for this column, pass this link to aggregator stage and use count function within the output link of the aggregator stage. This will give you the count of the source rows.
Provide derivation as @OUTROWNUM for this column, pass this link to aggregator stage and use count function within the output link of the aggregator stage. This will give you the count of the source rows.
Success consists of getting up just one more time than you fall.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The @INROWNUM system variable gives you this count as each row is processed. Therefore in the last row it has the total number of rows in the source file.
Pass this through an Aggregator stage with either Last or Max as the aggregation function (Last is more efficient) to get just that number output.
Or you can pass any non null column through an Aggregator with the Count function.
Pass this through an Aggregator stage with either Last or Max as the aggregation function (Last is more efficient) to get just that number output.
Or you can pass any non null column through an Aggregator with the Count 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.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.