Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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
Author Message
naive

New User


Joined: 26 Apr 2005
Posts: 47
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
References
naive

New User


Joined: 26 Apr 2005
Posts: 47
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: 4684
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: 47
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: 4684
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1