The BLKSIZE (Block Size) parameter specifies the size, in bytes, of physical blocks used to store records in a dataset. This parameter is crucial for I/O efficiency, as it determines how many logical records are stored in each physical block and affects both storage utilization and performance.
Key Benefit:
Properly specified BLKSIZE can significantly improve I/O performance by reducing the number of physical I/O operations required to process a dataset. Larger block sizes generally improve throughput but must be balanced with memory and device constraints.
123//ddname DD DSN=dataset.name, // DCB=(BLKSIZE=nnnnn,...), // ...other parameters...
Where nnnnn
is the block size in bytes.
123//ddname DD DSN=dataset.name, // DCB=(RECFM=FB,LRECL=80), // ...other parameters...
Note that BLKSIZE is omitted here, allowing z/OS to determine the optimal block size automatically.
Dataset Type | Minimum | Maximum |
---|---|---|
DASD datasets | LRECL value | 32,760 bytes |
Tape datasets (standard) | LRECL value | 32,760 bytes |
Tape datasets (large) | LRECL value | Up to 256KB in certain environments |
VSAM datasets | N/A | N/A (controlled by CISIZE/CASIZE) |
Block size requirements and calculations depend on the record format (RECFM):
RECFM | BLKSIZE Requirements | Calculation Formula |
---|---|---|
F (Fixed unblocked) | Must equal LRECL | BLKSIZE = LRECL |
FB (Fixed blocked) | Must be a multiple of LRECL | BLKSIZE = LRECL × n (where n = number of records per block) |
V (Variable unblocked) | Must be at least LRECL+4 | BLKSIZE ≥ LRECL+4 (to accommodate BDW) |
VB (Variable blocked) | Must be at least LRECL+8 | BLKSIZE ≥ LRECL+8 (to accommodate BDW and at least one RDW) |
U (Undefined) | Any valid value | Usually set to maximum allowed (e.g., 32760) |
Note:
For variable-length records, the Block Descriptor Word (BDW, 4 bytes) and Record Descriptor Words (RDW, 4 bytes each) are included in the block size calculation. The formula for maximum records per block is more complex than for fixed-length records.
Modern z/OS systems can automatically determine optimal block sizes. This is recommended in most cases as it ensures efficient use of device capabilities.
Dataset Type | Typical BLKSIZE | Notes |
---|---|---|
Source code libraries (FB, LRECL=80) | 27920 or 32720 | 27920 = 80 × 349 (349 records per block) |
Print files (FBA, LRECL=133) | 13300 or 26600 | 13300 = 133 × 100 (100 records per block) |
Data files (FB, various LRECL) | Half-track or full-track | Typically calculated to fit evenly on tracks |
Variable-length files (VB) | 32760 | Often maximum size for most efficient I/O |
Load module libraries (U) | 32760 | Maximum to accommodate variable-sized modules |
1234//SRCLIB DD DSN=USER.SOURCE.LIB, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(10,5,50)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920)
This example creates a partitioned dataset with fixed-length 80-byte records and a block size of 27920 bytes, which fits 349 records per block.
1234//DATAFILE DD DSN=USER.DATA.FILE, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)), // DCB=(RECFM=FB,LRECL=400)
This example creates a dataset with fixed-length 400-byte records but allows the system to determine the optimal block size automatically.
1234//LOGFILE DD DSN=USER.APPLICATION.LOG, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,2)), // DCB=(RECFM=VB,LRECL=1028,BLKSIZE=32760)
This example creates a variable-length dataset with a maximum record length of 1028 bytes and the maximum block size of 32760 bytes.
12345//BACKUP DD DSN=USER.BACKUP.FILE, // DISP=(NEW,CATLG,DELETE), // UNIT=TAPE, // VOL=SER=TAPE01, // DCB=(RECFM=FB,LRECL=8000,BLKSIZE=32000)
This example creates a tape dataset with a block size of 32000 bytes, chosen to be a multiple of the record length and close to the maximum allowed.
Formula for calculating records per block (FB):
Records_per_block = floor(BLKSIZE ÷ LRECL)
Actual_BLKSIZE = Records_per_block × LRECL
Storage_efficiency = (Actual_BLKSIZE ÷ Track_capacity) × 100%
Example:
For LRECL=80, a BLKSIZE of 27920 gives 349 records per block
27920 ÷ 80 = 349 records per block
349 × 80 = 27920 bytes (exactly matches specified BLKSIZE)
27920 ÷ 56664 ≈ 49.3% track utilization (approximately half-track blocking)
BLKSIZE Strategy | Benefits | Drawbacks |
---|---|---|
Small block sizes |
|
|
Large block sizes |
|
|
System-determined |
|
|
Issue | Possible Causes | Solutions |
---|---|---|
ABEND013-DC | BLKSIZE conflicts with device capabilities |
|
ABEND013-68 | BLKSIZE not compatible with RECFM/LRECL |
|
Inefficient I/O | Suboptimal BLKSIZE for device |
|
Wasted space | BLKSIZE not aligned with LRECL |
|
Multi-volume limitations | BLKSIZE unsuitable for spanning volumes |
|
BLKSIZE is part of the data management system rather than the job entry subsystem, so it functions identically in both JES2 and JES3 environments.
Note:
For SYSOUT datasets, JES2 and JES3 handle the data similarly regardless of BLKSIZE specification. Internal spool management uses JES-specific block structures.