DD KEYLEN Parameter
DD KEYLEN Parameter
Note! KEYLEN parameter is required only when we are creating a dataset.
The KEYLEN parameter is used to specify the key length while creating the new dataset. The KEYLEN parameter is optional. If KEYLEN is not coded, the dataset does not have any keys.
KEYLEN applies to BDAM, BPAM, BSAM, EXCP, and QSAM access methods and to VSAM datasets with SMS.
Syntax -
KEYLEN=bytes
bytes | Specifies the key length in bytes. The key length is 0 to 255 for non-VSAM datasets and 1 to 255 for VSAM KSDS. The key length should be less than or equal to the record length. |
Examples -
Scenario - Creating new dataset of key length 8.
//DD01 DD DSN=MTH.DATA.PS,
// DISP=(NEW,CATLG,DELETE),
// UNIT=3390,
// SPACE=(CYL,(12,2),RLSE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600),
// KEYLEN=8