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 

remove duplicate records using sort

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


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Fri Mar 16, 2007 8:02 pm    Post subject: remove duplicate records using sort Reply with quote

Hello,


I am trying to remove the duplicate records from input using sum field=none,

1) Not getting desired output when i use sort fields=copy.
2) Getting desired output when i use sort fields=(1,80,ch,a)

why option#1 is not working can you please advise.


Below is the code
Code:

//STEP01   EXEC PGM=SORT   
//SYSOUT   DD  SYSOUT=*     
//SORTIN   DD  *           
 1234   ABC  XYA  0923     
 4444   BBB  XXX  1111     
 3333   AAA  YYY  0002     
 1234   ABC  XYA  0923     
 2222   AAA  YYY  0000     
 4444   BBB  XXX  1111     
 3333   AAA       0002     
/*                         
//SORTOUT  DD SYSOUT=*     
//SYSIN    DD *             
 SORT FIELDS=copy   
 SUM FIELDS=NONE           
/*                         

Output should be.
Code:

1234   ABC  XYA  0923     
2222   AAA  YYY  0000     
3333   AAA       0002     
3333   AAA  YYY  0002     
4444   BBB  XXX  1111     



thank you in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Mar 16, 2007 9:22 pm    Post subject: Reply with quote

js01,

In order to eliminate duplicates you need to have a key. With Sort fields=copy you are just copying the records as is. So you will not eliminate any duplicates. Sum fields=none has no effect when you are using sort fields=copy.

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Sat Mar 17, 2007 12:01 am    Post subject: Reply with quote

Kolusu,

Thank you very much for your answer.
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