The SPACE parameter specifies how much disk space to allocate for a new data set. It defines the primary allocation amount, secondary allocation amount (for extending the data set), and directory space for partitioned data sets.
1//ddname DD SPACE=(unit,(primary[,secondary][,directory]))
1//ddname DD SPACE=(unit,(primary[,secondary][,directory])[,RLSE][,CONTIG|MXIG|ALX][,ROUND])
1//ddname DD SPACE=(ABSTR,(primary,address[,directory]))
Unit | Description | Example |
---|---|---|
TRK | Tracks | SPACE=(TRK,(10,5)) |
CYL | Cylinders | SPACE=(CYL,(2,1)) |
blocklength | Average block length in bytes | SPACE=(800,(100,50)) |
K | Kilobyte (1024 bytes) | SPACE=(1K,(500,100)) |
M | Megabyte (1,048,576 bytes) | SPACE=(1M,(10,5)) |
Requests that unused space be released when the data set is closed.
Example: SPACE=(TRK,(100,10),RLSE)
Option | Description |
---|---|
CONTIG | Requests contiguous space for the primary allocation |
MXIG | Requests the largest available contiguous block of space on the volume |
ALX | Requests allocation of up to five separate contiguous blocks of space |
When allocating by average block length, ROUND ensures that the space allocated is a whole number of cylinders.
Example: SPACE=(800,(100,50),,ROUND)
12//OUTDD DD DSN=USER.DATA.SET,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(TRK,(10,5))
Allocates 10 tracks initially with 5 tracks for each extension
12//CYLDD DD DSN=USER.LARGE.FILE,DISP=(NEW,CATLG,DELETE), // UNIT=3390,SPACE=(CYL,(5,2),RLSE)
Allocates 5 cylinders initially with 2 cylinders for each extension, releasing unused space at close
123//LIBDD DD DSN=USER.SOURCE.LIB,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(TRK,(50,20,10)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160,DSORG=PO)
Creates a library with 50 tracks initial allocation, 20 tracks for extensions, and 10 directory blocks
12//BLKDD DD DSN=USER.BLOCK.FILE,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(6144,(200,50))
Allocates space based on an average block length of 6144 bytes, with 200 blocks initially
12//MAXDD DD DSN=USER.MAX.SPACE,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(CYL,(100,50),,MXIG)
Allocates the largest available contiguous space on the volume, up to 100 cylinders
12//KDD DD DSN=USER.KB.FILE,DISP=(NEW,CATLG,DELETE), // UNIT=SYSDA,SPACE=(1K,(1000,200))
Allocates space for approximately 1000 1K blocks initially
12//ABSDD DD DSN=USER.SPECIAL.FILE,DISP=(NEW,CATLG,DELETE), // UNIT=3390,SPACE=(ABSTR,(15,100))
Allocates 15 tracks beginning at absolute track address 100 (rarely used in modern systems)
Records per track = Track capacity / (Record length + Overhead)
Primary tracks = (Total records / Records per track) × Safety factor (1.1-1.2)
Typically 10-20% of primary allocation
Directory blocks = (Number of members / 5) + 1
Allocate space for both member data and directory