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

Need to remove duplicates


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

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Thu Nov 03, 2011 12:53 am
Reply with quote

Hi

I have a file
---key----------------
AAAAAAAAAAAAAAA KKKK
AAAAAAAAAAAAAAA KKKK FFFFF
AAAAAAAAAAAAAAA KKKK FFFFF JJJJJJ


i am sorting the file to remove duplicates from the file using the key But i need to get the last duplicate record of the file. which is

AAAAAAAAAAAAAAA KKKK FFFFF JJJJJJ
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 03, 2011 12:56 am
Reply with quote

do not double post...
just tell what is the sort product You are using
messages starting with
WER ==> SYNCSORT
ICE ==> DFSORT
Back to top
View user's profile Send private message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Thu Nov 03, 2011 12:58 am
Reply with quote

I am using SYNCSORT
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Nov 03, 2011 12:58 am
Reply with quote

Ah, Enrico, I've sort of posted the same as you in the DFSORT thread, saying that I will delete this one, any objections ?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 03, 2011 12:59 am
Reply with quote

OK... topic in the DFSORT Forum will be deleted
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 03, 2011 1:00 am
Reply with quote

I just love it, when replies have time warp issues !
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Nov 03, 2011 1:03 am
Reply with quote

Oh well, on the bright side we may have educated someone to state the required info when posting ................. but on past experience

I'm back into my Tardis to see this one again icon_lol.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 03, 2011 1:10 am
Reply with quote

if it were dfsort I would have used something like

Code:
 ****** ***************************** Top of Data ******************************
 000001 //ENRICO1  JOB NOTIFY=&SYSUID,                                         
 000002 //             MSGLEVEL=(1,1),CLASS=A,MSGCLASS=X                       
 000003 //*                                                                     
 000004 //ICE     EXEC PGM=ICETOOL                                             
 000005 //TOOLMSG   DD SYSOUT=*                                                 
 000006 //DFSMSG    DD SYSOUT=*                                                 
 000007 //IN        DD *                                                       
 000008 AAAAAAAAAAAAAAA XXXX                                                   
 000009 AAAAAAAAAAAAAAA XXXX YYYY                                               
 000010 AAAAAAAAAAAAAAA XXXX YYYY ZZZZ                                         
 000011 BBBBBBBBBBBBBBB IIII                                                   
 000012 CCCCCCCCCCCCCCC LLLL                                                   
 000013 CCCCCCCCCCCCCCC LLLL MMMM                                               
 000014 //OUT       DD SYSOUT=*                                                 
 000015 //TOOLIN    DD *                                                       
 000016   SELECT FROM(IN) TO(OUT) ON(1,15,CH) LAST                             
 ****** **************************** Bottom of Data ****************************


result
Code:
AAAAAAAAAAAAAAA XXXX YYYY ZZZZ                                                 
BBBBBBBBBBBBBBB IIII                                                           
CCCCCCCCCCCCCCC LLLL MMMM                         


most probably it might work also for SYNCTOOL ( SYNCSORT equivalent )
Back to top
View user's profile Send private message
akodakka

New User


Joined: 20 May 2010
Posts: 75
Location: India

PostPosted: Thu Nov 03, 2011 1:15 am
Reply with quote

Thanks Enrico...i tried this and it worked...and my query is this will be giving the same result as SUM FIELDS=NONE using SYSNSORT

Code:

//JSTP010   EXEC PGM=SYNCTOOL                                           
//DFSMSG    DD SYSOUT=*                                                 
//TOOLMSG   DD SYSOUT=*                                                 
//IN    DD DSN=XXXXXX.TEST.FILE,DISP=SHR                               
//OUT   DD DSN=XXXXXX.TEST.OUA,                                         
//             DISP=(NEW,CATLG,KEEP),                                   
//             UNIT=SYSDA,                                             
//             SPACE=(CYL,(15,15),RLSE)                                 
//TOOLIN    DD *                                                       
  SELECT FROM(IN) TO(OUT) ON(1,15,CH) LAST                             
/*                                                                     
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Nov 03, 2011 1:16 am
Reply with quote

Enrico, and now you can post the invoice icon_lol.gif
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Nov 03, 2011 3:55 am
Reply with quote

akodakka wrote:
Thanks Enrico...i tried this and it worked...and my query is this will be giving the same result as SUM FIELDS=NONE using SYSNSORT

[...]


And the answer you give to yourself will be found by running it.
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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top