|
View previous topic :: View next topic
|
| Author |
Message |
meenasomu
New User

Joined: 15 Sep 2005 Posts: 17
|
|
|
|
Hi,
My requirement is to remove duplicates from the input records and select only specific fields from the input rec to output rec.
When i used ICETOOL with SUM FIELDS = NONE, the duplicates weren't removed. When i used the same control card using SORT, it worked.
Can anyone explain why i was not able to remove the duplicates using ICETOOL.
I have given the JCL that i used for reference.
Using ICETOOL,
| Code: |
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(INDD) TO(OUTDD) USING(CTR1)
/*
//INDD DD *
12345ABCDEFGHIJKL67890MNOPQRST
12345ABCDEFGHIJKL67890MNOPQRST
/*
//OUTDD DD SYSOUT=*
//CTR1CNTL DD *
SORT FIELDS=(6,2,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1:4Z,5:6,4,5X,14:6,4)
/*
The output is
ABCD ABCD
ABCD ABCD
|
Using SORT,
| Code: |
//STEP001 EXEC PGM=SORT
//SORTIN DD *
12345ABCDEFGHIJKL67890MNOPQRST
12345ABCDEFGHIJKL67890MNOPQRST
/*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(6,2,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1:4Z,5:6,4,5X,14:6,4)
/*
The output is
ABCD ABCD
|
Thanks in Advance.
Regards,
Meena. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
When I run your jobs with DFSORT, I get the same result for both cases (one record).
You're using a COPY operator with a SORT statement instead of a SORT operator with a SORT statement. In older versions of DFSORT, this would result in a COPY (SUM FIELDS=NONE has no meaning for a COPY since there's no key). In newer versions, it results in a SORT. So you're either using an older version of DFSORT or another product. Change your ICETOOL statement to:
SORT FROM(INDD) TO(OUTDD) USING(CTR1)
and you will get a SORT rather than a COPY.
By the way, here's another way to do this with DFSORT/ICETOOL:
| Code: |
//STEP003 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(INDD) TO(OUTDD) ON(6,2,CH) FIRST -
USING(CTR1)
/*
//INDD DD *
12345ABCDEFGHIJKL67890MNOPQRST
12345ABCDEFGHIJKL67890MNOPQRST
/*
//OUTDD DD SYSOUT=*
//CTR1CNTL DD *
OUTFIL FNAMES=OUTDD,OUTREC=(1:4Z,5:6,4,5X,14:6,4)
/*
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|