DD DCB Parameter


Note! DCB (Data Control Block) parameter is required and used only when we are creating a dataset.

The DCB parameter provides information about the organization, record format, record length, block size, and other dataset attributes.

DCB parameter is mandatory while creating the dataset through JCL. In all other cases, it is an optional parameter.

DCB parameters in the job can specify the operating system about how to read or write the data within the dataset once it is created.

Syntax -

//DDname DD DSN=datasetname,DCB=parameters

Detailed Syntax -

[DCB=(subparameter[,subparameter]...)]
[DCB=({dsname}[,subparameter]...) ]

Backard reference syntax -

[DCB=({*.ddname                      }) ]
[DCB=({*.stepname.ddname             }) ]
[DCB=({*.stepname.procstepname.ddname}) ]

The parenthesis are ignored if only one subparameter, dataset name, or backward reference is coded. If multiple subparameters are coded, those should be separated by a comma and enclosed by parenthesis.

Frequently used parameters -

Some mostly used DCB parameters and their meanings include -

  • BLKSIZE - Specifies the block size of the dataset.
  • DSORG - Specifies the organization of the dataset. Valid values include PS (physical sequential), PO (partitioned organization), and PDS (partitioned dataset).
  • KEYLEN - Specifies the key length of the dataset.
  • LRECL - Specifies the record length of the dataset.
  • RECFM - Specifies the record format of the dataset. Valid values include F (fixed length), V (variable length), and U (undefined).
  • DSNTYPE - Specifies the type of dataset. Valid values include LIBRARY (for a PDS), and BASIC or EXTENDED (for a PS dataset).

Default and overrides -

The system gets the DCB information in the below sources and their overriding order -

  • Processing program FD statements.
  • DD statement DCB parameter.
  • Dataset label.

Examples -


Scenario - Define a PS file with fixed-length record of 80 and a block size of 800 bytes.

//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=800)