BLKSIZE Parameter

Purpose

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.

Where BLKSIZE is Used

  • In DD statements as part of the DCB parameter
  • In TSO ALLOCATE commands
  • In the DCB macro for assembler programs
  • In dynamic allocation services (SVC 99)
  • Within SMS data class definitions

Basic Syntax

jcl
1
2
3
//ddname DD DSN=dataset.name, // DCB=(BLKSIZE=nnnnn,...), // ...other parameters...

Where nnnnn is the block size in bytes.

System-Determined Block Size

jcl
1
2
3
//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.

BLKSIZE Value Ranges

Dataset TypeMinimumMaximum
DASD datasetsLRECL value32,760 bytes
Tape datasets (standard)LRECL value32,760 bytes
Tape datasets (large)LRECL valueUp to 256KB in certain environments
VSAM datasetsN/AN/A (controlled by CISIZE/CASIZE)

BLKSIZE and RECFM Interaction

Block size requirements and calculations depend on the record format (RECFM):

RECFMBLKSIZE RequirementsCalculation Formula
F (Fixed unblocked)Must equal LRECLBLKSIZE = LRECL
FB (Fixed blocked)Must be a multiple of LRECLBLKSIZE = LRECL × n (where n = number of records per block)
V (Variable unblocked)Must be at least LRECL+4BLKSIZE ≥ LRECL+4 (to accommodate BDW)
VB (Variable blocked)Must be at least LRECL+8BLKSIZE ≥ LRECL+8 (to accommodate BDW and at least one RDW)
U (Undefined)Any valid valueUsually 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.

System-Determined Block Size (SDB)

Modern z/OS systems can automatically determine optimal block sizes. This is recommended in most cases as it ensures efficient use of device capabilities.

  • To use system-determined block size, simply omit the BLKSIZE parameter
  • The system will calculate an optimal BLKSIZE based on:
    • Device type characteristics
    • RECFM and LRECL values
    • Track capacity considerations
    • System performance settings
  • SDB is available for both SMS-managed and non-SMS-managed datasets
  • SDB can be controlled using the SYSTEM BLKSIZE parameter in SMS data classes

Common BLKSIZE Values

Dataset TypeTypical BLKSIZENotes
Source code libraries (FB, LRECL=80)27920 or 3272027920 = 80 × 349 (349 records per block)
Print files (FBA, LRECL=133)13300 or 2660013300 = 133 × 100 (100 records per block)
Data files (FB, various LRECL)Half-track or full-trackTypically calculated to fit evenly on tracks
Variable-length files (VB)32760Often maximum size for most efficient I/O
Load module libraries (U)32760Maximum to accommodate variable-sized modules

Usage Examples

Fixed-Length Blocked Dataset

jcl
1
2
3
4
//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.

System-Determined Block Size

jcl
1
2
3
4
//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.

Variable-Length Blocked Dataset

jcl
1
2
3
4
//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.

Tape Dataset

jcl
1
2
3
4
5
//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.

BLKSIZE Optimization Techniques

  • Track Capacity Utilization: Choose a BLKSIZE that maximizes track usage
    • For 3390 DASD: Aim for block sizes that are efficient divisors of 56,664 bytes (track capacity)
    • Half-track blocking: Approximately 27,998 bytes
    • Full-track blocking: Approximately 56,664 bytes, minus overhead
  • Fixed-Length Record Optimization:
    • Make BLKSIZE a multiple of LRECL to avoid wasted space
    • Calculate records per block: floor(BLKSIZE ÷ LRECL)
    • Recalculate optimal BLKSIZE: records_per_block × LRECL
  • Large Block Interface (LBI):
    • Allows block sizes larger than 32,760 bytes for certain devices (primarily tape)
    • Can significantly improve tape utilization and backup/restore performance
    • Requires hardware and software support

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)

Performance Implications

BLKSIZE StrategyBenefitsDrawbacks
Small block sizes
  • Lower buffer space requirements
  • More granular access to records
  • More I/O operations required
  • Lower throughput
  • More overhead (block headers)
Large block sizes
  • Fewer I/O operations required
  • Higher throughput
  • Less overhead overall
  • Higher buffer space requirements
  • Might waste memory for random access
  • Potential for internal fragmentation
System-determined
  • Optimal for device characteristics
  • Adapts to different device types
  • No need for manual calculations
  • Less control over specific settings
  • May not be optimal for unique situations

Common Issues and Troubleshooting

IssuePossible CausesSolutions
ABEND013-DCBLKSIZE conflicts with device capabilities
  • Ensure BLKSIZE doesn't exceed device limits
  • Use system-determined block sizes
ABEND013-68BLKSIZE not compatible with RECFM/LRECL
  • For FB, ensure BLKSIZE is a multiple of LRECL
  • For VB, ensure BLKSIZE ≥ LRECL+8
Inefficient I/OSuboptimal BLKSIZE for device
  • Use system-determined block sizes
  • Calculate optimal BLKSIZE for track capacity
Wasted spaceBLKSIZE not aligned with LRECL
  • For FB, use BLKSIZE = n × LRECL
  • Analyze track capacity utilization
Multi-volume limitationsBLKSIZE unsuitable for spanning volumes
  • Ensure BLKSIZE doesn't exceed volume limits
  • Use VSAM for multi-volume datasets with large records

Best Practices

  1. Use System-Determined Block Sizes: In most cases, let the system determine optimal block sizes by omitting the BLKSIZE parameter.
  2. For Fixed-Length Records: If manually specifying BLKSIZE, make it a multiple of LRECL for efficient storage.
  3. For Sequential Processing: Use large block sizes to minimize I/O operations and maximize throughput.
  4. For Tape Datasets: Use the maximum supported block size for most efficient tape utilization.
  5. For PDS Libraries: Use half-track or optimal track blocking to balance directory access and data access.
  6. Documentation: Document the rationale for non-standard block sizes to aid future maintenance.
  7. Consistency: Use consistent block sizes for similar datasets to simplify management.
  8. Consider Memory Constraints: Remember that larger block sizes require more buffer space in programs.

JES2 vs JES3 Considerations

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.

Related Concepts

  • RECFM Parameter - Record format specification that affects BLKSIZE requirements
  • LRECL Parameter - Logical record length, crucial for calculating appropriate BLKSIZE
  • DSORG Parameter - Dataset organization that affects BLKSIZE considerations
  • DCB Parameter - Data Control Block parameters that include BLKSIZE
  • SPACE Parameter - Space allocation, which interacts with BLKSIZE for storage efficiency