MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question on duplicate elimination

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Tue Sep 28, 2004 11:29 pm    Post subject: Question on duplicate elimination Reply with quote

Hi,

I have the following input data for SORT.

00000001AAAAAAAAAAAAA77
00000002AAAAAAAAAAAAA66
00000003AAAAAAAAAAAAA21
00000004AAAAAAAAAAAAA55
00000005AAAAAAAAAAAAA77
00000006AAAAAAAAAAAAA88
00000007AAAAAAAAAAAAA66
00000008AAAAAAAAAAAAA21

My SORT condition is

SORT FIELDS=(9,15,CH,A)
SUM FIELDS=NONE

The output is

00000003AAAAAAAAAAAAA21
00000004AAAAAAAAAAAAA55
00000002AAAAAAAAAAAAA66
00000005AAAAAAAAAAAAA77
00000006AAAAAAAAAAAAA88

Please note that 00000005AAAAAAAAAAAAA77 was kept while 00000001AAAAAAAAAAAAA77 was reoved. I wanted the first occurrence to be kept and 2nd removed. How can I achieve that?

Note: I am using SYNCSORT.

Regards
Ranjish
Back to top
View user's profile Send private message
Siva Kumar Sunku
Beginner


Joined: 17 Aug 2004
Posts: 25
Topics: 14

PostPosted: Tue Sep 28, 2004 11:53 pm    Post subject: Reply with quote

Hi Ranjish,
Following Code may help you.
Code:

//STEP020  EXEC PGM=SYNCSORT       
//SYSPRINT DD  SYSOUT=*             
//SORTIN   DD  *                   
00000001AAAAAAAAAAAAA77             
00000002AAAAAAAAAAAAA66             
00000003AAAAAAAAAAAAA21             
00000004AAAAAAAAAAAAA55             
00000005AAAAAAAAAAAAA77             
00000006AAAAAAAAAAAAA88             
00000007AAAAAAAAAAAAA66             
00000008AAAAAAAAAAAAA21             
/*                                 
//SORTOUT  DD  SYSOUT=*             
//SYSOUT   DD  SYSOUT=*             
//SYSIN    DD  *                   
  SORT FIELDS=(9,15,CH,A),EQUALS   
  SUM FIELDS=NONE                   


Result

    00000003AAAAAAAAAAAAA21
    00000004AAAAAAAAAAAAA55
    00000002AAAAAAAAAAAAA66
    00000001AAAAAAAAAAAAA77
    00000006AAAAAAAAAAAAA88


EQUALS is the keyword that maintains the order of the input records.
Hope this helps you.

-Siva.
Back to top
View user's profile Send private message AIM Address
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Wed Sep 29, 2004 12:08 am    Post subject: Reply with quote

Hi Siva,

Your code worked. Thank you very much for the quick reply.

Regards
Ranjish
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group