counting the rows for a similar column and making a header
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 2
- Joined: Tue Nov 24, 2015 4:00 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is probably most easily accomplished by sorting the data in reverse (or reading the file backwards), adding the "headers" at the end of each group, then sorting again back into forward order.
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.
-
- Participant
- Posts: 36
- Joined: Thu Dec 03, 2009 9:11 pm
- Location: Malaysia
Re: counting the rows for a similar column and making a head
Hi,
SeqFile ---- Aggreator ---- TargetFile
Group by on the first column and then in the aggreator use the count function to get the number of records.
That will resolve your issue
Regards
Naveen
SeqFile ---- Aggreator ---- TargetFile
Group by on the first column and then in the aggreator use the count function to get the number of records.
That will resolve your issue
Regards
Naveen
Naveen Kumar
Datastage Consultant
Datastage Consultant
How will that solve their problem? They need more than a simple count of the records.
Output:
COMP1 003
COMP2 002
COMP3 001
Perhaps if you explained how it can be combined with the source data, ensuring that the counts come first in the output, then you'd have a solution.
Output:
COMP1 003
COMP2 002
COMP3 001
Perhaps if you explained how it can be combined with the source data, ensuring that the counts come first in the output, then you'd have a solution.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers