IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SORT eliminate duplicates with count


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rakesh1155

New User


Joined: 21 Jan 2009
Posts: 84
Location: India

PostPosted: Tue Sep 01, 2009 9:25 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Sep 01, 2009 9:51 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top