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
 

 

How to eliminate duplicates by retaining last record ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to eliminate duplicates by retaining last record ?
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    Post subject:
Reply with quote

Hi All,

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

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

Senior Member


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

PostPosted: Thu Aug 19, 2010 11:09 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10274
Location: italy

PostPosted: Thu Aug 19, 2010 11:44 pm    Post subject: Reply to: How to eliminate duplicates by retaining last reco
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

Senior Member


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

PostPosted: Fri Aug 20, 2010 12:07 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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