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.
1//ddname DD UNIT=unit-information
1//ddname DD UNIT=(unit-type[,unit-count][,DEFER])
Value Type | Description | Example |
---|---|---|
Device Type | IBM device type or equivalent | SYSDA, DISK, TAPE, 3390, 3480 |
Group Name | Installation-defined group of devices | SYSALLDA, SYSTAPE, CART |
Device Address | Specific device by address | 150, 270 |
Device Number | Specific device by number | 3390-1, 3480-4 |
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.
Requests deferred mounting of volumes. The system allocates the device but does not mount the volume until the data set is opened.
Name | Description | Common Use |
---|---|---|
SYSDA | Direct access storage devices | General disk storage |
SYSALLDA | All direct access storage devices | When any disk device is acceptable |
DISK | Direct access storage devices | Alternative to SYSDA in some installations |
3390 | IBM 3390 disk device | Specific disk device type |
SYSTAPE | Tape devices | General tape storage |
TAPE | Tape devices | Alternative to SYSTAPE in some installations |
3480 | IBM 3480 tape cartridge device | Specific tape device type |
VIO | Virtual I/O (simulated disk in memory) | Temporary, high-performance storage |
SYSVIO | Virtual I/O devices | Alternative to VIO in some installations |
12//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
12//DISKDD DD DSN=PROD.MASTER.FILE,DISP=SHR, // UNIT=3390
Requests a 3390 disk device for an existing data set
12//TAPEDD DD DSN=BACKUP.WEEKLY,DISP=(NEW,KEEP), // UNIT=TAPE,LABEL=(1,SL)
Creates a new data set on a tape device
123//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
12//ARCHDD DD DSN=ARCHIVE.MONTHLY,DISP=OLD, // UNIT=(TAPE,,DEFER)
Requests a tape device but defers mounting until the data set is opened
12//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
12//SPECDD DD DSN=CRITICAL.DATA,DISP=OLD, // UNIT=150
Requests a specific device by its address (150)
12//ERROR1 DD DSN=TEST.DATA,DISP=NEW, // UNIT=3380 // If 3380 devices no longer exist
12//ERROR2 DD DSN=SMS.MANAGED.DATASET,DISP=(NEW,CATLG), // UNIT=SYSDA // May be ignored by SMS
123//ERROR3 DD DSN=MULTI.VOLUME,DISP=(NEW,CATLG), // UNIT=(SYSDA,2),VOL=SER=(VOL1,VOL2,VOL3) // // Only 2 units for 3 volumes
12//ERROR4 DD DSN=SELDOM.USED.TAPE,DISP=SHR, // UNIT=TAPE // Should use DEFER if not used immediately
12//ERROR5 DD DSN=GENERAL.DATA,DISP=(NEW,CATLG), // UNIT=3390-2 // Too specific, SYSDA would be better
12//ERROR6 DD DSN=NEW.DATASET,DISP=(NEW,CATLG), // SPACE=(CYL,(10,5)) // Missing UNIT parameter