View previous topic :: View next topic
|
Author |
Message |
richie
New User
Joined: 11 Jun 2005 Posts: 24
|
|
|
|
Hi,
I have two files of LRECL 350
I would like to sort these files on (1,9,CH,A,85,8,CH,D,251,1,CH,D).
1:9 - client-no 85:8 product-date 251:1 priroity
After Sorting , i want to retain the first record and eliminate duplicates only on first key 1:9 i.e client-no
SUM FIELDS= NONE checks on the complete sort-key i.e client-no , exam-date and priority to remove duplicates.
rather i would like to remove all records having duplicate client-no here.
Any advise please.Thanks a lot. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Richi,
You can add one more step in ur job to again sort on Client number & use OPTION EQUALS to retain the first record
Code: |
OPTION EQUALS
SORT FIELDS=(1,9,CH,A)
SUM FIELDS=NONE |
|
|
Back to top |
|
|
richie
New User
Joined: 11 Jun 2005 Posts: 24
|
|
|
|
Hi Ekta,
Thanks for your reply.
I know i can do it in two steps. Was wondering if this can be done in a single step.
Any advise to do this in single step.
Thanks!
Richie! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Richie,
Here's a DFSORT/ICETOOL job that will do what you want in one pass:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,9,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(1,9,CH,A,85,8,CH,D,251,1,CH,D)
/*
|
|
|
Back to top |
|
|
richie
New User
Joined: 11 Jun 2005 Posts: 24
|
|
|
|
Thanks Frank.
I will check if it works. |
|
Back to top |
|
|
|