DD SPACE Parameter


The SPACE parameter is used to specify the amount of disk space required for creating a new dataset. The allocation should request on direct access volume (DSAD).

SPACE parameter can override and extend the space allocated for the already created dataset. SPACE is an optional parameter.

Syntax -

SPACE=({Allocation-parameter,}
      (primary-qty[,second-qty][,directory])
      [,RLSE][,CONTIG or MXIG or ALX][,ROUND])

Allocation-parameter -

It specifies the measurement unit for memory allocation. The valid values are -

TRK Requests the space allocation in tracks.
CYL Requests the space allocation in cylinders.
BLKLGTH Specifies the average block length in bytes.
It will be coded when AVGREC parameter not coded.
BLKLGTH valid values are 0-65535.
RECLGTH Specifies the average record length in bytes.
RECLGTH valid values are 0-65535.

Primary Quantity (primary-qty) -

  • It specifies the amount of primary space needed for the dataset.
  • The coded volume should have enough space, requested in primary quantity. If enough space is not available, the job will be terminated.
  • Primary quantity allows values from 0-16777215.

Secondary Quantity (secondary-qty) -

  • It specifies the amount of additional space required for the dataset.
  • Secondary quantity allows values from 0-16777215.
  • The system will only allocate the secondary space when needed and is used to extend the memory for the already created datasets.

Directory -

  • The amount of space in bytes that is reserved for directory blocks.
  • The directory is for partitioned dataset (PDS) or partitioned dataset extended (PDSE). The directory value should code during the PDS creation.
  • The valid directory values are from 0-16777215.

RLSE -

  • RLSE releases the memory allocated to the dataset when the dataset is closed. RLSE function notifies the close function to release unused space on the dataset closes.
  • RLSE function does not affect primary and secondary allocation.

CONTIG -

  • CONTIG parameter specifies that the memory allocated should be contiguous and applies to primary memory allocation.
  • If the CONTIG option is specified during the allocation and no contiguous space is available, the JOB will be terminated.

MXIG -

  • MXIG parameter specifies that the memory allocation should be done on the largest contiguous memory location.
  • If no contiguous memory location is available, the system will check for at least the primary quantity of contiguous memory available.

ALX -

  • ALX parameter specifies to the system that the memory to the dataset allocation is to up to 5 largest available locations on the same volume.
  • Each allocation size should be greater than or equal to the primary quantity.

ROUNDED -

  • The ROUNDED parameter specifies that the memory allocation to the dataset should be equal to the average block.
  • If TRK and CYLs are coded, the ROUNDED parameter is ignored.

Examples -


Scenario1 - Defines the temporary dataset.

//DD01  DD  DSN=&TEMPMTH,SPACE=(CYL,10)

Scenario2 - Allocate PS with 3 TRKs primary and 2 TRKs seconday memory.

//MATEPKI  JOB (123),'MTH',NOTIFY=&SYSUID 
//*
//STEP10   EXEC PGM=IEFBR14
//DD1      DD DSN=MATEPK.IEFBR14.PSFILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(3,2),RLSE),
//            UNIT=SYSDA,VOLUME=SER=DEVHD4,
//            DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=800)

Scenario3 - Allocate PDS.

//MATEPKP  JOB (123),'MTH',NOTIFY=&SYSUID
//*
//STEP01   EXEC PGM=IEFBR14
//DD1      DD DSN=MATEPK.IEFBR14.PDSFILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(TRK,(10,10,10),RLSE),
//            UNIT=SYSDA,VOLUME=SER=DEVHD4,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)

Scenario4 - Allocate contiguous memory.

//MATEPKP  JOB (123),'MTH',NOTIFY=&SYSUID
//*
//STEP01   EXEC PGM=IEFBR14
//DD1      DD DSN=MATEPK.IEFBR14.PDSFILE,
//            DISP=(NEW,CATLG,DELETE),
//            SPACE=(CYL,(10,5,10),RLSE,CONTIG),
//            UNIT=SYSDA,VOLUME=SER=DEVHD4,
//            DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=800)