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
 

 

how to delete duplicate records from a flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
shan

New User


Joined: 10 Aug 2006
Posts: 7

PostPosted: Thu Aug 10, 2006 6:52 pm    Post subject: how to delete duplicate records from a flat file
Reply with quote

pls help me out
Back to top
View user's profile Send private message

cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Thu Aug 10, 2006 7:11 pm    Post subject: Re: how to delete duplicate records from a flat file
Reply with quote

Using a basic sort:

Code:

//SORT    EXEC PGM=SORT                             
//SORTIN   DD DSN=INPUT.FILE,DISP=SHR               
//SORTOUT  DD DSN=OUTPUT.FILE,                     
//          DISP=(NEW,CATLG),                       
//          UNIT=SYSDA,SPACE=(TRK,(60,15),RLSE),   
//          DCB=(RECFM=??,LRECL=???,BLKSIZE=0)     
//SYSOUT   DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=(2,5,CH,A)                             
  SUM FIELDS=NONE                                   


Your SORT field defines the duplicate field of the records. The 2 would represent the starting position of the duplicate field and the 5 would represent the length. Your duplicates will be gone and the SORTOUT file will contain the remainder of the records. Make sure your DCB on SORTOUT are valued correctly.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 10, 2006 9:19 pm    Post subject:
Reply with quote

Alternatively, you can use this DFSORT/ICETOOL job:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...   input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(p,m,f) FIRST


p,m,f is the starting position, length and format of the field you want to use to determine duplicates.

You can also use SELECT for many other types of operations involving duplicates (e.g. LAST, FIRSTDUP, LASTDUP, ALLDUPS, NODUPS, etc). See the following for more information on SELECT:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm


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