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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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