JCL DD LIKE

JCL – DD KEYLEN JCL – DD LRECL

Advertisements


LIKE parameter used to specify the allocation of new dataset attributes by copying from a model dataset.

The model dataset should be cataloged dataset and should be existed in direct access volume.

The below list of attributes can be copied from model dataset to new dataset.


  • Data set organization (RECORG) or(RECFM)
  • Record length (LRECL)
  • Key length (KEYLEN)
  • Key offset (KEYOFF)
  • Type (DSNTYPE)
  • Space allocation (AVGREC and SPACE)

LIKE parameter can be used with SMS only.

LIKE is an optional parameter.

If SMS is not installed or is not active, the system syntax checks and ignores the LIKE parameter.

The retention period (RETPD) or expiration date (EXPDT) is not copied to the new data set.


Note:

temporary data set (&&dsname) attributes can’t be copied by using LIKE parameter.

Syntax:

LIKE=data-set-name

data-set-name Specifies the data set name (dsname) of the model data set.

Defaults and overrides:


Any attributes attained using the LIKE parameter override the corresponding attributes in the DATACLAS parameter.

Any attributes specify on the same DD statement override the corresponding attributes obtained from the model data set.


Example 1:

//DD01  DD  DSNAME=MTH.DATA,LIKE=MTH.DATA1,DISP=(NEW,KEEP)

In the above example, the data set attributes used for MTH.DATA are obtained from the cataloged model data set MTH.DATA1.


Example 2:

//DD01  DD  DSNAME=MTH.DATA,LIKE=MTH.DATA1,DISP=(NEW,KEEP),
//          LRECL=900

In the above example, the data set attributes used for MTH.DATA are obtained from the cataloged model data set MTH.DATA1 and the logical record length of 900 overrides the logical record length obtained from the model data set.


JCL – DD KEYLEN JCL – DD LRECL

Advertisements