In this topic, we described about the DD LRECL with detailed example.
LRECL parameter is used to specify the records length in new datasets. LRECL is an optional parameter. LRECL applies to data sets with the BPAM, BSAM, EXCP, QISAM, and QSAM access methods. LRECL applies to VSAM with SMS.
|bytes||Specifies the length in bytes for fixed length records.|
Specifies the length in bytes for fixed length records.
Specifies the maximum length in bytes for variable-length records.
The value is 1 to 32,760 for non-VSAM data sets.
The value is 1 to 32,761 for VSAM key-sequenced (KS), entry-sequenced (ES), or relative record (RR) data sets.
For VSAM key-sequenced (KS) data sets, a record length must be specified.
The record length must be greater than the key length.
For RECFM=D or V, the length must be a minimum of 5 and a maximum of BLKSIZE minus 4. For RECFM=VS, the length can exceed BLKSIZE.
LRECL=0 is valid only for RECFM=U.
//DD01 DD DSNAME=MTH.DATA,DISP=(NEW,KEEP), // RECFM=FB,LRECL=625
In the above example, the logical record length of 625 is used for the new data set MTH.DATA.
//DD01 DD DSNAME= MTH.DATA,DATACLAS=DCLAS07,DISP=(NEW,KEEP), //LRECL=625
In the above example, the logical record length of 625 overrides the logical record length defined in the data class for the data set.