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
 
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 VSAM - Accessing beyond record size Benchwarmer JCL & VSAM 6 Wed Apr 11, 2018 9:20 pm
No new posts Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm
No new posts Need urgent suggestion on DFSORT subratarec DFSORT/ICETOOL 6 Wed Mar 21, 2018 8:46 pm
No new posts WRITE to VSAM giving duplicate RC picus_mf CICS 1 Fri Feb 23, 2018 2:52 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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