UNIT Parameter

Purpose

The UNIT parameter specifies the device type on which a data set should be allocated. It identifies the general type of device, a specific device, or a group of devices defined by the installation. The UNIT parameter is crucial for controlling where data sets are stored in the mainframe environment.

Syntax

Basic Format

jcl
1
//ddname DD UNIT=unit-information

Extended Format

jcl
1
//ddname DD UNIT=(unit-type[,unit-count][,DEFER])

Parameter Values

Unit Type

Value TypeDescriptionExample
Device TypeIBM device type or equivalentSYSDA, DISK, TAPE, 3390, 3480
Group NameInstallation-defined group of devicesSYSALLDA, SYSTAPE, CART
Device AddressSpecific device by address150, 270
Device NumberSpecific device by number3390-1, 3480-4

Unit Count

Specifies the maximum number of devices to be allocated to the data set. Valid values are 1-59. This is typically used for multi-volume data sets.

DEFER Option

Requests deferred mounting of volumes. The system allocates the device but does not mount the volume until the data set is opened.

Common Device Types and Groups

NameDescriptionCommon Use
SYSDADirect access storage devicesGeneral disk storage
SYSALLDAAll direct access storage devicesWhen any disk device is acceptable
DISKDirect access storage devicesAlternative to SYSDA in some installations
3390IBM 3390 disk deviceSpecific disk device type
SYSTAPETape devicesGeneral tape storage
TAPETape devicesAlternative to SYSTAPE in some installations
3480IBM 3480 tape cartridge deviceSpecific tape device type
VIOVirtual I/O (simulated disk in memory)Temporary, high-performance storage
SYSVIOVirtual I/O devicesAlternative to VIO in some installations

Examples

Basic UNIT Specification

jcl
1
2
//OUTDD DD DSN=USER.DATA.SET,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(10,5))

Allocates a new data set on any device in the SYSDA group

Specific Device Type

jcl
1
2
//DISKDD DD DSN=PROD.MASTER.FILE,DISP=SHR, // UNIT=3390

Requests a 3390 disk device for an existing data set

Tape Data Set

jcl
1
2
//TAPEDD DD DSN=BACKUP.WEEKLY,DISP=(NEW,KEEP), // UNIT=TAPE,LABEL=(1,SL)

Creates a new data set on a tape device

Multi-Volume Data Set

jcl
1
2
3
//BIGDD DD DSN=LARGE.DATA.SET,DISP=(NEW,CATLG,DELETE), // UNIT=(SYSDA,3),SPACE=(CYL,(500,50)), // VOL=SER=(VOL001,VOL002,VOL003)

Allocates a data set that can span up to 3 SYSDA devices, with specific volume serial numbers

Deferred Mounting

jcl
1
2
//ARCHDD DD DSN=ARCHIVE.MONTHLY,DISP=OLD, // UNIT=(TAPE,,DEFER)

Requests a tape device but defers mounting until the data set is opened

Temporary Data Set

jcl
1
2
//TEMPDD DD DSN=&&TEMP,DISP=(NEW,DELETE), // UNIT=VIO,SPACE=(TRK,(5,2))

Creates a temporary data set using virtual I/O for high performance

Specific Device Address

jcl
1
2
//SPECDD DD DSN=CRITICAL.DATA,DISP=OLD, // UNIT=150

Requests a specific device by its address (150)

UNIT Selection Process

  1. SMS Management: For SMS-managed data sets, UNIT may be ignored as SMS controls placement
  2. Existing Data Sets: For OLD, SHR, or MOD of existing data sets, UNIT is used if the system needs to allocate the device
  3. New Data Sets: For NEW or MOD of new data sets, UNIT determines eligible devices for allocation
  4. Generic vs. Specific: Generic names (like SYSDA) give the system more flexibility in allocation
  5. Unit Count: With multiple units specified, the system allocates devices for each volume up to the unit count
  6. Affinity: The system tries to minimize the number of devices used while honoring the requirements

Use Cases

Disk Storage Management

  • Allocating standard data sets on disk storage (SYSDA)
  • Controlling placement of data sets on specific device types
  • Managing multi-volume data sets that span multiple disks
  • Using VIO for high-performance temporary data sets

Tape Management

  • Creating backup data sets on tape devices
  • Managing archive data with deferred mounting
  • Controlling tape device selection for specific media types
  • Allocating multiple tape drives for large backup operations

Performance Optimization

  • Balancing I/O workload across multiple devices
  • Using high-performance storage for critical data sets
  • Optimizing temporary data set performance with VIO
  • Separating data sets with high activity to different physical devices

Special Requirements

  • Allocating data sets on specific devices for testing or recovery
  • Using installation-defined device groups for specialized storage
  • Managing removable media with deferred mounting
  • Controlling device allocation for security or auditing requirements

Limitations and Considerations

  • SMS Override: For SMS-managed data sets, the UNIT parameter may be ignored as SMS controls placement
  • Installation Dependencies: Available unit names and groups are installation-specific and may vary
  • Device Availability: Allocation fails if the requested device type is not available
  • ACS Routines: SMS Automatic Class Selection routines may influence device selection regardless of UNIT
  • UNIT vs. STORCLAS: For SMS-managed data sets, STORCLAS typically has precedence over UNIT
  • Hardware Dependencies: Specific device types may have hardware-specific requirements
  • Unit Count Restrictions: The maximum unit count is 59, but practical limits are usually much lower

Common Mistakes

  • Specifying Unavailable Devices: Requesting device types that don't exist at the installation
    jcl
    1
    2
    //ERROR1 DD DSN=TEST.DATA,DISP=NEW, // UNIT=3380 // If 3380 devices no longer exist
  • Ignoring SMS Management: Specifying UNIT for data sets that will be SMS-managed anyway
    jcl
    1
    2
    //ERROR2 DD DSN=SMS.MANAGED.DATASET,DISP=(NEW,CATLG), // UNIT=SYSDA // May be ignored by SMS
  • Unit Count Mismatch: Specifying unit count that doesn't match volume count
    jcl
    1
    2
    3
    //ERROR3 DD DSN=MULTI.VOLUME,DISP=(NEW,CATLG), // UNIT=(SYSDA,2),VOL=SER=(VOL1,VOL2,VOL3) // // Only 2 units for 3 volumes
  • Forgetting DEFER for Tapes: Not using DEFER for tapes that aren't immediately needed
    jcl
    1
    2
    //ERROR4 DD DSN=SELDOM.USED.TAPE,DISP=SHR, // UNIT=TAPE // Should use DEFER if not used immediately
  • Using Specific Devices Unnecessarily: Specifying a particular device when any would do
    jcl
    1
    2
    //ERROR5 DD DSN=GENERAL.DATA,DISP=(NEW,CATLG), // UNIT=3390-2 // Too specific, SYSDA would be better
  • Omitting UNIT for New Data Sets: Not specifying UNIT for new non-SMS data sets
    jcl
    1
    2
    //ERROR6 DD DSN=NEW.DATASET,DISP=(NEW,CATLG), // SPACE=(CYL,(10,5)) // Missing UNIT parameter

Best Practices

  • Use Generic Names: Prefer generic unit names (SYSDA, TAPE) over specific device types when possible
  • Follow Installation Standards: Use standard unit names defined by your installation
  • Consider SMS Management: Remember that SMS may override UNIT specifications
  • Use DEFER for Tapes: Specify DEFER for tape data sets that aren't used immediately
  • Match Unit Count to Volumes: Ensure unit count is appropriate for the number of volumes
  • Use VIO for Temporary Data: Consider using VIO for small, temporary data sets
  • Balance Performance: Distribute high-activity data sets across different devices
  • Document Special Requirements: If using specific device types, document the reason
  • Be Consistent: Use consistent unit specifications across related jobs
  • Check Availability: Ensure requested device types are available at all execution sites

Related Concepts

Related Pages