Information
Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see UNLOAD PLUS for DB2 13.1.

SORTWK data sets


SORTWK data sets are the work files that BMCSORT uses.

When you specify DIRECT YES, BMCSORT uses the SORTWK data sets in the unload phase for processing.

For any job in which UNLOAD PLUS performs a sort, you must allocate SORTWK files in one of the following ways:

  • (recommended) Have BMCSORT dynamically allocate SORTWK data sets.
  • Explicitly specify SORTWK DD statements in your JCL. Use this option when you want to control the allocation of your SORTWK data sets.

Dynamically allocating SORTWK data sets

BMCSORT dynamically allocates SORTWK data sets under either of the following circumstances:

  • You specifically request dynamic allocation through command or installation options as described in the following table.
  • BMCSORT determines that it needs more sort work space than you have allocated in your JCL, and dynamic allocation is enabled through command or installation options.

Several factors affect this dynamic allocation. The following table describes the results of combining these factors:

SORTNUM or SORTDEVT

Third parameter of BMCSORT DYNALOC

Results

SORTDEVT specified

or

SORTNUM n specified (where n is greater than 0)

ON or OFF

If the value is OFF, specifying a value greater than 0 for SORTNUM or specifying SORTDEVT changes this value to ON.

If you specify a SORTNUM value that is greater than 32, BMCSORT allocates the number of data sets that it determines it needs, up to the specified number of data sets per task.

Otherwise, BMCSORT allocates the number of data sets that it determines it needs up to 32 per task.

SORTDEVT not specified

and

SORTNUM 0

ON

BMCSORT allocates the number of data sets that it determines it needs, up to 32 per task.

OFF

BMCSORT does not allocate any sort work data sets and attempts to perform sort processing in memory.

To ensure that BMCSORT has enough information to allocate SORTWK space accurately and efficiently, specify the ENUMROWS command option and a value greater than 0 for the SORTNUM command option.

Allocating SORTWK data sets in your JCL

If you cannot dynamically allocate SORTWK data sets, you must specify SORTWK DD statements in your JCL. The number of SORTWK files should be evenly divisible by the number of tasks, with a minimum of two files per task. Available resources might limit the number of concurrent tasks to four; therefore, if you allocate twelve SORTWK files, UNLOAD PLUS can run up to four tasks without wasting sort space.

Warning

Important

When determining the number of concurrent tasks to run, UNLOAD PLUS checks the amount of allocated SORTWK space. In these calculations, UNLOAD PLUS uses only the primary allocation because the secondary allocation is not guaranteed.

Calculating partitioned sort work space

If the table space is partitioned, you can use the formulas in this section to calculate the minimum amount of sort work space that UNLOAD PLUS requires. This strategy allows enough sort work space to perform the sort. If the resulting data set size is not optimal, the elapsed time for the unload increases, but the utility can complete processing, despite the space constraint.

To determine the data set size when you specify the partitions to unload (by using the PART option), calculate the following value, and divide it by the number of SORTWK data sets that you are allocating. Use values from your largest single partition.

(# rows selected * (avg. output record length + longest key length + 12 bytes)) * number of specified partitions

To determine the data set size when you are not specifying any partitions, calculate the following value and divide it by the number of SORTWK data sets that you are allocating. Use values from your largest single partition. MAXP is the maximum number of partitions that you want to unload concurrently with a single task.

(# rows selected * (avg. output record length + longest key length + 12 bytes)) * MAXP

Calculating nonpartitioned sort work space

To determine the data set size for a nonpartitioned table space, use the following formula to calculate the value, and divide it by the number of SORTWK data sets that you are allocating.

# rows selected * (avg. output record length + longest key length + 12 bytes)

Restrictions

You cannot allocate a SORTWK data set as any of the following data set types:

  • A VIO data set
  • A tape data set
  • A multi-volume data set
  • A data set in an SMS storage group that specifies EXTENDED FORMAT YES

    BMCSORT does not support SORTWK data sets that extend beyond 65535 tracks on a single volume.

Consideration

When unloading from multiple table spaces, UNLOAD PLUS attempts to use multiple tasks to unload partitioned table spaces first. After unloading the partitioned table spaces, UNLOAD PLUS uses multiple tasks to unload all remaining table spaces, assigning one table space per task. You must ensure that you allocate enough sort work space to the sort work data sets so that there is sufficient space to sort the largest participating table space. If you are using UNLOAD PLUS to unload from multiple table spaces, we recommend that you allocate enough sort work space to each set of sort work data sets so that there is sufficient space to sort the largest participating table space.

 

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

UNLOAD PLUS for DB2 11.2