DD LRECL Parameter


Note! LRECL parameter is required only when we are creating a dataset.

The LRECL (Logical Record Length) parameter is used to specify the record length for new datasets during the creation. LRECL is an optional parameter.

LRECL applies to datasets that are using BPAM, BSAM, EXCP, QISAM, and QSAM access methods.

Syntax -

DCB=(LRECL=record_length)
record_length Specifies the physical record length in bytes.
The value is 1 to 32,767 for non-VSAM datasets.
The record length should be greater than the key length.

Examples -


Scenario - Defining an PS with LRECL of 500 bytes

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORD=PS,RECFM=FB,LRECL=500,BLKSIZE=5000)