IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Urgent: Duplicate record removal


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Sat Feb 04, 2006 4:06 am
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
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 Developer


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

PostPosted: Sat Feb 04, 2006 6:07 am
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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top