KEYLEN parameter - IBM-JCL

Parameter Type

Keyword, optional

Purpose
Use the KEYLEN parameter to specify the length of the keys used in a newdata set.

Code the KEYLEN parameter when you want to:

  • Specify a key length for the data set or
  • With SMS, override the key length defined in the data class of the data set.

The key length can be supplied from the data set label (or data class with SMS). If a key length is not specified or supplied, input or output requests must not require keys.

KEYLEN applies to data sets with the BDAM, BPAM, BSAM, EXCP, QISAM, and TCAM access methods, and, with SMS, to VSAM data sets.

1.Syntax

KEYLEN=bytes

2.Subparameter Definition

bytes
Specifies the length, in bytes, of the keys used in the data set. The number of bytes is:

  • 0 to 255 for non-VSAM data sets. The key length must be less than or equal to the record length.

Note: Use only 0 for a member of a partitioned data set extended (PDSE). Use 0 or 8 to perform input operations on the directory of a PDSE.

  • 1 to 255 for VSAM key-sequenced (RECORG=KS) data sets. A key length must be specified, either explicitly with the KEYLEN or LIKE parameter, or in the data class for the data set. The key length must be less than the record length.

3.Overrides
KEYLEN overrides the key length specified in the data set label, and with SMS, KEYLEN overrides the key length defined in the DATACLAS parameter for the data set.

4.Relationship to Other Parameters
Do not code the following DD parameters with the KEYLEN parameter.

* DCB=STACK
DATA DCB=TRTCH
DCB=KEYLEN DDNAME
DCB=MODE DYNAM
DCB=PRTSP

5.Examples of the KEYLEN Parameter

Example

//DD4 DD DSNAME=JST,DISP=(NEW,KEEP),UNIT=3350,
// SPACE=(CYL,(12,2)),DCB=(A.B.C),KEYLEN=8

DD statement DD4 defines a new data set named JST and requests that the system copy the DCB information from the data set label of the cataloged data set named A.B.C. If the data set label contains a key length specification, it is overridden by the KEYLEN coded on this DD statement.

Example

//SMSDS3 DD DSNAME=MYDS3.PGM,DATACLAS=VSAM1,DISP=(NEW,KEEP), // KEYLEN=6

In the example, where the data class VSAM1 defines a key-sequenced VSAM data set, the key length of 6 overrides the key length defined in the data class.

KEYOFF parameter

Parameter Type

Keyword, optional — use this parameter only with SMS Without SMS, use the RKP subparameter of the DCB parameter.

Purpose

Use the KEYOFF parameter to specify the key offset, the position of the first byte of the record key in each logical record of a new VSAM data set. The first byte of a logical record is position 0.

If SMS is not installed or is not active, the system syntax checks and then ignores the KEYOFF parameter. Code the KEYOFF parameter only for a VSAM key-sequenced data set (RECORG=KS).

Code the KEYOFF parameter when you want to (1) specify a key offset for the data set or (2) override the key offset defined in the data class of the data set.

1.Syntax

KEYOFF=offset-to-key

offset-to-key
Specifies the position (offset), in bytes, of the first byte of the key in each record. The offset is 0 to the difference between the record length (LRECL) and key length (KEYLEN), in the range 0 to 32,760.

3.Overrides
KEYOFF overrides the key offset defined in the DATACLAS parameter for the data set.

4.Relationship to Other Parameters
Do not code the following DD parameters with the KEYOFF parameter.

* DYNAM DATA FCB DCB=RESERVE FREE=CLOSE DCB=RKP UCS DDNAME

5.Example of the KEYOFF Parameter

//SMSDS3 DD DSNAME=MYDS3.PGM,DATACLAS=VSAM1,DISP=(NEW,KEEP),
// KEYOFF=2

In the example, the data class VSAM1 defines a key-sequenced VSAM data set. The key offset of 2 overrides the key offset defined in the data class and specifies that the first byte of the key is in the third position of each record.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM-JCL Topics