View previous topic :: View next topic |
Author |
Message |
js01 Beginner
Joined: 13 Oct 2005 Posts: 84 Topics: 32 Location: INDIA
|
Posted: Fri Mar 16, 2007 8:02 pm Post subject: remove duplicate records using sort |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Mar 16, 2007 9:22 pm Post subject: |
|
|
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 |
|
 |
js01 Beginner
Joined: 13 Oct 2005 Posts: 84 Topics: 32 Location: INDIA
|
Posted: Sat Mar 17, 2007 12:01 am Post subject: |
|
|
Kolusu,
Thank you very much for your answer. |
|
Back to top |
|
 |
|
|