View previous topic :: View next topic
|
Author |
Message |
selvakumar_ms
New User
Joined: 30 Mar 2004 Posts: 8
|
|
|
|
hi,
is there any chance to remove duplicate records in jcl sort? |
|
Back to top |
|
|
bluebird
Active User
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
Code: |
//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none
|
p1 pos of dup
l1 length
ch sort parm for character |
|
Back to top |
|
|
selvakumar_ms
New User
Joined: 30 Mar 2004 Posts: 8
|
|
|
|
bluebird wrote: |
hello,
Code: |
//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none
|
p1 pos of dup
l1 length
ch sort parm for character |
excuse me i couldn't get u |
|
Back to top |
|
|
anuradha
Active User
Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
|
|
|
|
hi selvakumar_ms,
I will try to xplain you more clearly for what bluebird said:
//sysin dd*
sort fields=(p1,l1,ch)
sum fields=none
In the above sysin stmt,if we specify sum fields=none it will automatically take care of removing duplicates while sorting.
p1 in sort filelds is nothing but the position of duplicates.
l1 is length of those fields from p1.
ch is sort parameter for character.
If you have key field of length 7 bytes on which you want to eliminate duplicates then the following JCL will give you the results.
Code:
Code: |
//STEP001 EXEC PGM=SORT
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR.INPUT.FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR.OUTPUT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=(1,7,CH,A)
SUM FIELDS=NONE
/* |
Thanks
Anu |
|
Back to top |
|
|
bluebird
Active User
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
thanx anurada. Nice to see that somebody outthere reads me... |
|
Back to top |
|
|
|