Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Sep 02, 2010 11:08 am Post subject:
RonB wrote:
Just out of curiosity, why did you add the EQUALS parameter to the last sort statement, and remove it from the first sort statement?
EQUALS is the DEFAULT option with SELECT operator of DFSORT. So you really don't have to code it.
RonB wrote:
But there was no such requirement to keep the EQUALS order in the third sort (input to the last step ).
I thought just in case if OP needs to retain the original order of the duplicates if any. I usually go by the notion that there WILL be duplicates when you sort and the order IS always important. If the order is not important or he doesn't have duplicates, OP can get rid of EQUALS option on CTL2 DD
EQUALS is the DEFAULT option with SELECT operator of DFSORT. So you really don't have to code it.
Does that mean that the SELECT operator somehow knows what ALL of the SORT fields are ( not just the ON(...) portion ) and causes the SORT operation to apply EQUALS across the board? _________________ A computer once beat me at chess, but it was no match for me at kick boxing.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Sep 02, 2010 12:18 pm Post subject:
SELECT calls DFSORT to sort the records according to the ON fields. If you override the SORT statement used for the DFSORT call, DFSORT uses that SORT statement and applies EQUALS to all of the fields. Note that if you do override the SORT statement, it must start with the SORT statement generated by SELECT for the ON fields. SELECT also compares the sorted records, but only by the ON fields.
ICETOOL calls DFSORT with the following control statements based on the ON field:
Code:
OPTION EQUALS
SORT FIELDS=(1,30,CH,A)
However, the SORT statement in CTL1CNTL overrides that SORT statement, so DFSORT actually uses:
Code:
SORT FIELDS=(1,30,CH,A,397,26,CH,D)
Note that 397,26,CH,D has been added to the SORT statement so DFSORT sorts by the 1,30,CH,A field and then by the 397,26,CH,D field. EQUALS is in effect because ICETOOL passed it to DFSORT.
After the records are sorted by 1,30,CH,A,397,26,CH,D, ICETOOL does the SELECT processing against them by comparing each pair of records using the ON field - 1,30,CH. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
I have completed the testing and the fine tuning suggested by all of you have helped us save more than 50% of the elapsed time. This is indeed great. I would like to thank all of you for devoting time to this issue.
For the benefit of others, I have used the code as suggested by Kolusu/Frank.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Fri Sep 10, 2010 2:47 pm Post subject:
That's good news. Thanks for taking the time to provide feedback. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
All times are GMT - 5 Hours Goto page Previous1, 2
Page 2 of 2
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