DD UNIT Parameter


Note! UNIT parameter is required only when we are creating a dataset.

The UNIT parameter is used to specify the system name on which the new dataset is going to be created. Generally, a unit can be a tape drive, disk drive, or other storage devices. UNIT is an optional parameter.

Syntax -

UNIT=([ddd        ] [,unit-count] [,DEFER])
     ([/ddd       ] [,P         ] [,     ])
     ([/dddd      ] [,          ])
     [device-type]
     [group-name ]
device-number It is 3-digit or 4-digit hexadecimal number that is pre-defined device number.
device-type Specifies pre-defined IBM-supplied name for the device type.
group-name Specifies pre-defined symbolic name for group of devices.
unit-count Specifies pre-defined number of devices from 1 through 59.
P Specifies the system to allocate the same number of devices from the volume count or SER subparameter, whichever is higher.
DEFER Specifies the system to assign the dataset to device(s).

Default and overrides -

If SYSOUT and UNIT are coded on the same statement, the SYSOUT parameter overrides the UNIT parameter.

Examples -


Scenario1 - Defines a dataset on DASD (Direct Access Storage Device - SYSDA).

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600)

Scenario2 - Defines a new dataset on TAPE device (3490).

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=3490,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600)

Scenario3 - Defines a new dataset on two devices.

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=(,2),
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600)