Dynamic data set allocation


LOADPLUS enables you to dynamically allocate the data sets that are needed during the load job.

You activate dynamic data set allocation through command syntax or installation defaults. When dynamic allocation is active, LOADPLUS calculates the optimal size and number of data sets and allocates them for you. Dynamic allocation reduces or eliminates the need to specify DD statements for these files in your JCL. LOADPLUS also optionally deletes the work files.

With dynamic allocation, you spend less time performing analysis to set up optimized JCL for LOADPLUS jobs. Also, you will not need to modify the JCL for the LOADPLUS job as Db2 objects change size or structure over time.

In a two-phase load, dynamic allocation occurs at the beginning of the PRELOAD phase. For a single-phase load, this allocation occurs at the beginning of the COMBINED phase.

The following topics describe the standard dynamic data set allocation process and options for most situations.

Important

The following special conditions apply:

  • You can also have LOADPLUS dynamically allocate your input (SYSREC) data sets by using the INDSN command option. However, LOADPLUS does not analyze requirements for these data sets and does not use the standard LOADPLUS dynamic allocation options that this section describes. The considerations in this section do not apply to input data sets. For more information, see INDSN.
  • When LOADPLUS invokes DSNUTILB, you must enable dynamic allocation for the required data sets. You can use some of the options described in this section to control the dynamic allocation of these data sets, but DSNUTILB handles the allocation.

For information about allocating a particular data set type, see LOADPLUS-DD-statements.

Enabling dynamic allocation

To enable and use dynamic data set allocation quickly and simply, specify the following options:

  • Enable automated file size estimation either in your installation options (AUTOENUMROWS=YES) or on your LOAD command (ENUMROWS AUTO).
  • For any of the DDTYPEs that you want to dynamically allocate, specify ACTIVE YES on your LOAD command or in your installation options.

For more options that you can use with dynamic allocation, see ENUMROWS and Dynamic-allocation-options.

Using dynamic allocation in a worklist environment

When running in a worklist environment, the utility ignores the ACTIVE option in your installation options module. The utility dynamically allocates your data sets only if the invoking product (DASD MANAGER PLUS, Catalog Manager, or Change Manager) supplies the ACTIVE YES syntax. 

Generating data set names

You can use the DSNPAT option to specify a pattern to generate a unique data set name.

Names created with DSNPAT

The data set name pattern (DSNPAT) option allows you to specify text and variable data for building data set names. If you cannot construct a data set name that meets your organization’s standards by using text and the supplied variables, LOADPLUS provides an exit point that allows you to create your own variables for use with DSNPAT. Sample exits written in assembler, COBOL, C, and LE C are described in LOADPLUS-user-exits and are provided in the HLQ.LLQSAMP library. For more information about the DSNPAT option, see DSNPAT.

The pattern that you specify in your DSNPAT option must allow LOADPLUS to generate unique data set names. For multiple SORTOUT and SYSUT1 files, you must include the &DDNAME variable to generate unique names. For copy data sets, you might need to include additional variables such as &VCAT, &DATEJ, or &TIME4 to generate unique names across multiple loads. If LOADPLUS encounters non-unique data set names, the job terminates.

GDG names

You can use generation data group (GDG) names for the following types of dynamically allocated files:

  • Copy data sets
  • SYSDISC files
  • SYSERR files
  • SYSMAP files

Each DDTYPE must have a different GDG base.

GDG name format

The GDG format that you use to construct data set names is the same as the format that you use in JCL to allocate data sets through DD statements: you append the generation number in parentheses. The open parenthesis tells LOADPLUS that the pattern is a GDG name. The generation number must be an integer from 1 through 255.

An example of a GDG name is &UTILPFX.&DDNAME.(+1). If you are using a substitution variable as the last variable before the open parenthesis, you must include a period before the open parenthesis.

GDG base

LOADPLUS has the following requirements for the number of GDG bases that you specify:

  • Each DDTYPE must have a different GDG base.
  • For copy data sets, each partition must have a different GDG base if you specify COPYLVL PART on the LOAD command.

If the base does not exist, LOADPLUS creates it for you, using everything in the pattern up to the open parenthesis as the base name.

When defining the base, LOADPLUS uses the values of the following options:

  • The GDGLIMIT installation or command option allows you to specify the number of generations to keep.
  • If the GDGLIMIT value is exceeded, the GDGEMPTY installation option tells the system to uncatalog either all preexisting generations of this data set or only the oldest generation.
  • The GDGSCRATCH installation option tells the system whether to delete the entry that was just uncataloged from the volume’s table of contents (VTOC).

For more information, see the descriptions for the dynamic allocation installation options, and the command option description for GDGLIMIT.

Specifying ddname prefixes

If you specify more than one ddname prefix for dynamic allocation, the prefix for each ddname must be different enough for the product to differentiate one prefix from another.

To be different enough, if these prefixes are different only because one prefix has additional trailing bytes, these trailing bytes must contain at least one non-numeric byte. For example, the first set of prefixes that follow is sufficiently different, but the second set is not:

  • Acceptable set:

    BMCRD
    BMCRDWK
  • Not acceptable set:

    BMCRD
    BMCRD11

The prefixes that you specify must allow the utility to add the data set number (or partition number in the case of copy data sets) and still result in a valid ddname of eight characters. If the generated name would result in a ddname of less than eight characters, the utility pads the data set or partition number with leading zeros.

The following table shows an example of how the prefixes that you specify resolve to the generated ddnames.

Prefix specified for SYSUT1 data sets

Number of data sets

Generated ddnames

SYSOUT1

9

SYSOUT1...SYSOUT9

SYSOUT1

10

None (invalid length)

WORK

10

WORK0001...WORK0010

Deleting dynamically allocated data sets

 You can choose to delete dynamically allocated data sets automatically after each successful job, or you can manually delete them.

Important

LOADPLUS also provides options that allow you to specify an expiration date or retention period for certain dynamically allocated data sets. For more information, see EXPDT and RETPD.

Automatically deleting after successful jobs

To delete dynamically allocated data sets, specify DELETEFILES YES on your LOAD command. After the load job completes successfully, LOADPLUS automatically deletes the work files that it dynamically allocated and those allocated in your JCL, except SYSDISC. DELETEFILES YES does not apply to image copy data sets that LOADPLUS dynamically allocates.

You can also have LOADPLUS delete SYSDISC, if no records were written to this data set during the load process, by specifying SYSDISC YES. If LOADPLUS wrote records to SYSDISC during the load process, LOADPLUS does not automatically delete SYSDISC, allowing you to correct the discarded records that it contains and resubmit the job. You must manually delete SYSDISC in this case.

You can also specify these preferences with the DELFILES installation option. For more information about these options, see DELETEFILES or DELFILES=(YES,NO).

Deleting manually

The SYSPRINT from your LOADPLUS job contains a report of the dynamically allocated work files. When you need to delete work files manually, you can use this report to determine which files to delete.

Dynamically allocating larger data sets with different properties than smaller data sets

You can use the THRESHLD option and associated dynamic allocation options to tell the utility to use different properties for larger data sets than for smaller ones. Data set allocations that exceed the threshold value will use the values for the second parameter of applicable dynamic allocation options.

For example, you could use the following options to tell the utility to send data sets greater than 720 MB to tape device TAPE1, and smaller data sets to DASD device SYSDA:

UNIT(SYSDA,TAPE1)
THRESHLD 720000

For more information, see the THRESHLD option description.

Using SMS ACS routines to influence dynamic allocation

If your SMS automatic class selection (ACS) routines use the UNIT parameter to influence data set allocation, you can use the SMSUNIT option in the utility to affect that use.

The value of the SMSUNIT option affects the UNIT value as follows:

  • When you specify SMSUNIT YES, the utility passes the UNIT option to SMS allocation in addition to passing the SMS class options and other normally passed options.
  • When you specify SMSUNIT NO, the utility does not pass the UNIT option. 

Reaching the MAXTAPE limit during dynamic allocation

When UNIT and THRESHLD specifications require that the utility dynamically allocate tape units, allocation occurs in the following priority order:

  1. The utility attempts to allocate the greatest number of tape units required that will optimize multitasking.
  2. If this number of tape units exceeds the MAXTAPE value, the utility decreases the multitasking level until the number of tape units required is less than or equal to the MAXTAPE value.

    This action might result in the utility dynamically allocating a single SYSUT1 data set, rather than one data set for each non-data-sorting index (thus decreasing multitasking).

  3. If the minimum number of tape units required exceeds the MAXTAPE value, the utility issues a message and terminates.

The value that you specify for the MAXTAPE option includes the units that are required for full and incremental copy data sets.

Changing dynamic allocation options on restart

Before restarting a job, you might need to change the options that affect dynamic allocation.

For example, if specifying an invalid UNIT or overly restrictive MAXTAPE value causes the job to terminate, you need to change the relevant option before restarting the job.

The following restrictions apply to changes that you make to dynamic allocation options before restarting a job:

  • You cannot change the value for the ACTIVE option on any restart.
  • Changing any option on restart such that it results in different ddnames or a different number of DDs than the original option can produce an error. If you need to change the number of SORTOUT or SYSUT1 work files, resubmit the job with a parameter of NEW.
  • If you change the value of other dynamic allocation options, specify RESTART(PHASE).

For more restart considerations, see Restarting-LOADPLUS.  

 

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