Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SORT eliminate duplicates with count

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT eliminate duplicates with count
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    Post subject: Reply to: SORT eliminate duplicates with count
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us