Sorting out Sort key strategy
April 4, 2007
I (we) am loading a lot of data into a detail data set in IMAGE with a sort key. Do I presort the data by the sort key only? Or do I presort by the Automatic key then the sort key?
As in:
Entry Offset
BP-EXPLODE# X10 1 (!BP-EXPLODE-A(PRIORITY))
BP-BENEFIT X10 11 (BP-BENEFIT-A)
COMPONENT X4 21
RIDER-TITLE X8 25
YMDEFF X8 33
YMDEND X8 41
PRIORITY X2 49
I know this really improves performance.
Ray Shahan replies:
Since your sort key is at the end of the data set, then you need only sort by the sort key value.
Denys Beauchemin adds:
Sort by BP-EXPLODE# as the first key and PRIORITY as the second key within BP-EXPLODE#.