Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us