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

How to eliminate duplicates by retaining last record ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Thu Aug 19, 2010 2:34 pm
Reply with quote

Hi All,

I have data like this:

100 ABC
100 CDE
100 FGH
200 KLM
200 NOP
300 XYZ


I eliminated duplicate records by using below sort card.

Code:


SORT FIELDS=(1,3,CH,A)
SUM FIELDS=NONE


I got output like this:

Output:
100 ABC
200 KLM
300 XYZ

I want output mentioned like below where last record of the key is retained and all other records are eliminated.


Expected Output:
100 FGH
200 NOP
300 XYZ

Can get this using syncsort?? If so, please let me know.

Thanks,
Kalyan V
Back to top
View user's profile Send private message
kalyan.v

New User


Joined: 04 Feb 2008
Posts: 65
Location: Hyd

PostPosted: Thu Aug 19, 2010 3:29 pm
Reply with quote

Hi All,

I got the solution for this. It is already discussed in the forum.

www.ibmmainframes.com/viewtopic.php?t=41708&highlight=
Thanks,
Kalyan V
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Aug 19, 2010 11:09 pm
Reply with quote

Anyhow, the link you posted doesn't branch to a valid link. However, appreciate your effort in searching the Forum.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Aug 19, 2010 11:44 pm
Reply with quote

the link has been fixed!

these things happen because of the way the URL tag is managed

[ url= http : // your _ URL . com] [/url]

inside the square brackets of the starting tag the poster should put the URL,
outside the clear text and then the closing tag

and this is how the result would look

here is where I got the solution
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 20, 2010 12:07 am
Reply with quote

Thanks Enrico.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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 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