MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SEPARATING DUPLICATES

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
NorthernDancer
Beginner


Joined: 01 May 2007
Posts: 44
Topics: 22
Location: DOWNTOWN BUFFALO, NY

PostPosted: Tue Aug 12, 2008 2:10 pm    Post subject: SEPARATING DUPLICATES Reply with quote

I have a sequential file LRECL=210 with a SORT KEY @ 180 29 A comprised of CLAIM Id @ 180 11 A, Subscriber @ 191 18 A. I'm using DFSORT here. I want to get ONLY any DUPLICATE CLAIM IDs in an output file. Or get all unique claims in 1 output file and dups in a 2nd output file. So I've sorted the file on 180,29,CH,A and I can see the dups there. How can I leave only the DUPs on SORTOUT ?? Or can I split SORTIN into 2 SORTOU1 & SORTOU2 where SORTOU1 has got all the records except DUPS and SORTOU2 has got ONLY DUPS. I.E. SORTOU1 contains all unique CLAIN IDs and SORTOU2 contains only duplicate Claim IDs??
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Aug 12, 2008 2:36 pm    Post subject: Reply with quote

It's not clear what you want to use to determine duplicates. Is it the Claim ID only, or the Claim ID and the Subscriber ID? At any rate, you can use a DFSORT/ICETOOL job like the following to get the unique records in one file and the duplicates in another:

Code:

//S1    EXEC  PGM=ICETOOL                                     
//TOOLMSG   DD  SYSOUT=*                                       
//DFSMSG    DD  SYSOUT=*                                       
//IN DD DSN=...  input file                               
//UNIQUE DD DSN=...   unique output records                                         
//DUPS DD DSN=...  duplicate output records
//TOOLIN DD *                                                 
SELECT FROM(IN) TO(UNIQUE) DISCARD(DUPS) ON(p,m,CH) NODUPS     
/*


where p and m are the starting position and length, respectively, of the field you want to use to determine duplicates.

If that doesn't give you want you want, then show an example of the records in your input file and what you expect for output, and explain the "rules" for getting from input to output.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group