Executing the CA Rapid Reorg utility with a large number of rows, for example syntax REORG ... ESTIMATED-ROWS 370000000 with dynamic allocation of the sort work data sets for DFSORT.
Job finished with RC=08 along with abend SB37-04 and the following DFSORT messages:
IEC030I B37-04,IFG0554A,xxxxxxG,REORG,ST01WK04,524E,TMPD22, ...
ICE097I 2 xxxxxxx.REORG SORT RECOVERING FROM B37 ABEND ON SORTWK DATA SET
ICE083A D RESOURCES WERE UNAVAILABLE FOR DYNAMIC ALLOCATION OF WORK DATA SETS
The problem was due to lack of resources for the sort work data sets due to the large number of rows. The main parameter passed to sort that affects the
number and size of the dynamically allocated sort work data sets is FILSZ. With this large number of ESTIMATED-ROWS you can either increase the number of work data sets that sort can dynamically allocate per each sort via the SORT-SORTNUM option in highlvl.CDBAPARM member UTIL or the SORTNUM keyword in the utility syntax, or allocate the sort work data sets statically. If you allocate the sort work data sets statically then you have update the JCL.
For a partitioned tablespace ESTIMATED-ROWS is set to the number of rows in the largest partition. ESTIMATED-ROWS is passed as FILSZ to sort for data or partitioned index sorts. For NPI sorts, FILSZ is ESTIMATED-ROWS times the number of partitions in the table space.
If ESTIMATED-ROWS is not specified within the utility syntax, CA Rapid Reorg estimates object row counts from the DB2 Catalog RTS statistics. If the statistics are kept up to date then these are the most accurate estimating numbers.