DCB Parameter

Purpose

The DCB (Data Control Block) parameter specifies the physical characteristics of a data set, including record format, record length, block size, and organization. These attributes are essential for the operating system to correctly process and access the data.

Syntax

Basic Format

jcl
1
//ddname DD DCB=(subparameter,subparameter,...)

Common Subparameters Format

jcl
1
//ddname DD DCB=(RECFM=format,LRECL=length,BLKSIZE=size,DSORG=organization)

Key Subparameters

RECFM (Record Format)

ValueDescription
FFixed-length records
FBFixed-length, blocked records
FBAFixed-length, blocked with ANSI control characters
FBMFixed-length, blocked with machine code control characters
VVariable-length records
VBVariable-length, blocked records
VBAVariable-length, blocked with ANSI control characters
UUndefined-length records

LRECL (Logical Record Length)

Specifies the length, in bytes, of each logical record in the data set.

  • For fixed-length records (RECFM=F*): The exact length of each record
  • For variable-length records (RECFM=V*): The maximum length of any record (including the 4-byte record descriptor word)
  • For undefined-length records (RECFM=U): Optional, can be used to specify a maximum length

Common values: 80 (card images), 132 or 133 (print lines)

BLKSIZE (Block Size)

Specifies the length, in bytes, of each physical block in the data set.

  • For fixed-length blocked records: Must be a multiple of LRECL
  • For variable-length blocked records: Must be at least 4 bytes greater than LRECL
  • For optimal performance: Should be selected to maximize I/O efficiency (often between 6K and 32K)

Tip: For disk data sets, you can specify BLKSIZE=0 to let the system determine an optimal block size.

DSORG (Data Set Organization)

ValueDescription
PSPhysical Sequential - records stored one after another
POPartitioned Organization - a library with members (like source code libraries)
DADirect Access - records accessed by relative block address
VSVSAM - Virtual Storage Access Method organization

Other DCB Subparameters

SubparameterDescription
BUFNONumber of buffers to be allocated
KEYLENLength of keys for indexed or direct data sets
DENTape density
OPTCDOptional services codes
TRTCHTape recording technique

Examples

Basic Fixed-Length Records

jcl
1
2
3
//OUTDD DD DSN=USER.FIXED.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,5)),UNIT=SYSDA, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DSORG=PS)

Creates a new data set with fixed-length blocked records, 80-byte logical records, 8000-byte blocks

Variable-Length Records

jcl
1
2
3
//VARDD DD DSN=USER.VARIABLE.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(15,5)),UNIT=SYSDA, // DCB=(RECFM=VB,LRECL=256,BLKSIZE=6144,DSORG=PS)

Creates a new data set with variable-length blocked records, maximum record length of 256 bytes

Partitioned Data Set (Library)

jcl
1
2
3
//LIBDD DD DSN=USER.SOURCE.LIB,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(50,20,10)),UNIT=SYSDA, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160,DSORG=PO)

Creates a new partitioned data set (library) with directory blocks for members

Print File with Control Characters

jcl
1
2
//PRTDD DD SYSOUT=A, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6650)

Defines a print file with ANSI carriage control characters (the 'A' in FBA)

Using System-Determined Block Size

jcl
1
2
3
//OPTDD DD DSN=USER.OPTIMAL.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,5)),UNIT=SYSDA, // DCB=(RECFM=FB,LRECL=100,BLKSIZE=0,DSORG=PS)

Creates a new data set letting the system determine the optimal block size (BLKSIZE=0)

Referencing Model DCB

jcl
1
2
3
//REFDD DD DSN=USER.NEW.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,5)),UNIT=SYSDA, // DCB=*.STEP1.OLDDD

Creates a new data set with DCB attributes copied from OLDDD in STEP1

Alternative DCB Reference

jcl
1
2
3
//MODDD DD DSN=USER.LIKE.DATA,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,5)),UNIT=SYSDA, // DCB=(MODEL.DATA.SET,RECFM=VB)

Creates a new data set with DCB attributes from MODEL.DATA.SET, but overrides RECFM to VB

Best Practices

  1. Always specify DCB when creating new data sets to ensure they have the intended characteristics
  2. Choose appropriate RECFM based on the data structure and application requirements
  3. Use blocked records (FB, VB) for better performance and storage efficiency
  4. Consider system-determined block sizes (BLKSIZE=0) for optimal disk space utilization
  5. Document standard DCB values for your organization to ensure consistency
  6. Be cautious when altering DCB for existing data sets as it can make them unreadable

Related Concepts

  • DD Statement - The statement where DCB parameters are specified
  • SPACE Parameter - Used together with DCB to allocate space for new data sets
  • DISP Parameter - Controls data set disposition in conjunction with DCB characteristics