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
 

 

Urgent: Duplicate record removal

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

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Sat Feb 04, 2006 3:51 am    Post subject: Urgent: Duplicate record removal
Reply with quote

We are weeding out the differences from a file on the basis of a field A.

Is there any way we can retain the last occurence of a particular value of the field A and discard the duplicates? What I mean is :

Code:

Record number     Field A            Rest of record
1                 AAA                12345
5                 AAA                11111
10                AAA                22222



We need to keep the last record i.e record number 10 in our output and remove the other two!!

Any suggestions??????????????????????????????????????
Back to top
View user's profile Send private message

naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Sat Feb 04, 2006 3:53 am    Post subject: Re: Urgent: Duplicate record removal
Reply with quote

I am sorry: I meant we are weeding out duplicates from the record...(and not differences as in my prev post!!)
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: Sat Feb 04, 2006 4:06 am    Post subject:
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

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(19,7,CH) LAST                     
/*                                                           
Back to top
View user's profile Send private message
naive

New User


Joined: 26 Apr 2005
Posts: 46
Location: LA

PostPosted: Sat Feb 04, 2006 5:59 am    Post subject:
Reply with quote

Cooolllllll ..... Lemme try it out .. I will get back if I need anything else!!!
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: Sat Feb 04, 2006 6:07 am    Post subject:
Reply with quote

Ok. If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am


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