View previous topic :: View next topic
|
Author |
Message |
rakesh1155
New User
Joined: 21 Jan 2009 Posts: 84 Location: India
|
|
|
|
Hi All,
I have a flat file with 2000 records with duplicate key records. [key: (1,15,ch,a)]
To eliminate duplicates, I would put it as:
SORT FIELDS=(1,15,CH,A)
SUM FIELDS=NONE[size=9].
But, Is it possible to have a count of the number of records eliminated against each record: [similar to group by in db2 and count(*)]? |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
rakesh,
Assuming your input file lrecl is 80 and recfm FB , the following control cards will put the count of records for each key in pos 81 for 8 bytes
Code: |
//SYSIN DD *
INREC OVERLAY=(81:7C'0',C'1')
SORT FIELDS=(1,15,CH,A),EQUALS
SUM FIELDS=(81,8,ZD)
//* |
|
|
Back to top |
|
|
|