DEFINE CLUSTER

Using Access Method Services, you can set up jobs to execute a sequence of commands with a single invocation of IDCAMS. Modal command execution is based on the success or failure of prior commands.

Use DEFINE CLUSTER to define attributes for the cluster as a whole and for the components of the cluster. The general syntax of the DEFINE CLUSTER command is:
  • DEFINE CLUSTER (parameters) -
    • [DATA(parameters)] -
    • [INDEX(parameters)] -
    • [CATALOG(subparameters)]

See Understanding the Order of Assigned Data Set Attributes for information about the order of precedence of DEFINE command attributes.

Command Parameters
DEFINE CLUSTER
    (NAME(entryname)
    {CYLINDERS(primary[ secondary])|
     KILOBYTES(primary[ secondary])|
     MEGABYTES(primary[ secondary])|
     RECORDS(primary[ secondary])|
     TRACKS(primary[ secondary])}
    VOLUMES(volser[ volser...])
    [ACCOUNT(account–info)]
    [BUFFERSPACE(size)]
    [BWO(TYPECICS|TYPEIMS|NO)]
    [CONTROLINTERVALSIZE(size)]
    [DATACLASS(class)]
    [EATTR(NO|OPT)]
    [ERASE|NOERASE]
    [EXCEPTIONEXIT(entrypoint)]
    [FILE(ddname)]
    [FREESPACE(CI-percent[ CA-percent]|0 0)]
    [FRLOG(ALL|NONE|REDO|UNDO)]
    [INDEXED|LINEAR|NONINDEXED|NUMBERED|ZFS]
    [KEYLABEL(keyvalue)]
    [KEYS(length  offset| 64 0]
    [LOG(NONE|UNDO|ALL)]
    [LOGREPLICATE|NOLOGREPLICATE]
    [LOGSTREAMID(logstream)]
    [MANAGEMENTCLASS(class)]
    [MODEL(entryname[ catname])]
    [OWNER(ownerid)]
    [RECATALOG|NORECATALOG]
    [RECORDSIZE(average  maximum)]
    [REUSE|NOREUSE]
    [ | RLSQUIESCE]RLSENABLE
    [SHAREOPTIONS(crossregion[ crosssystem]|1 3)]
    [SPANNED|NONSPANNED]
    [SPEED|RECOVERY]
    [STORAGECLASS(class)]
   [TO(date)|FOR(days)]
    [WRITECHECK|NOWRITECHECK])
  [DATA (
    {CYLINDERS(primary[ secondary])|
     KILOBYTES(primary[ secondary])|
     MEGABYTES(primary[ secondary])|
     RECORDS(primary[ secondary])|
     TRACKS(primary[ secondary])}
    [VOLUMES(volser[ volser...])]
    [BUFFERSPACE(size)]
    [CONTROLINTERVALSIZE(size)]
    [ERASE|NOERASE]
    [EXCEPTIONEXIT(entrypoint)]
    [FILE(ddname)]
    [FREESPACE(CI-percent[ CA-percent])]
    [KEYS(length  offset)]
    [MODEL(entryname[ catname])]
    [NAME(entryname)]
    [OWNER(ownerid)]
    [RECORDSIZE(average  maximum)]
    [REUSE|NOREUSE]
    [SHAREOPTIONS(crossregion[ crosssystem])]
    [SPANNED|NONSPANNED]
    [SPEED|RECOVERY]
    [WRITECHECK|NOWRITECHECK])]
  [INDEX (
    {CYLINDERS(primary[ secondary])|
     KILOBYTES(primary[ secondary])|
     MEGABYTES(primary[ secondary])|
     RECORDS(primary[ secondary])|
     TRACKS(primary[ secondary])}
    [VOLUMES(volser[ volser...])]
    [CONTROLINTERVALSIZE(size)]
    [EXCEPTIONEXIT(entrypoint)]
    [FILE(ddname)]
    [MODEL(entryname [ catname])]
    [NAME(entryname)]
    [OWNER(ownerid)]
    [REUSE|NOREUSE]
    [SHAREOPTIONS(crossregion[ crosssystem])]
    [WRITECHECK|NOWRITECHECK])]
  [CATALOG(catname)]

DEFINE Abbreviation: DEF

A sequence of commands commonly used in a single job step includes DELETE––DEFINE––REPRO or DELETE––DEFINE––BLDINDEX. You can specify either a DD name or a data set name with these commands. When you refer to a DD name, however, allocation occurs at job step initiation. This could result in a job failure if a command such as REPRO follows a DELETE––DEFINE sequence that changes the location (volser) of the data set. A failure can occur with either SMS-managed data sets.

A VVDS cannot be modeled in an IDCAMS DEFINE command. Also, SMS forces VVDS defines to be non-SMS-managed, so assignments of EATTR values by either a DATACLAS or a MODEL routine are not allowed with the DEFINE of a VVDS. The EATTR assignments are only allowed explicitly in the DEFINE CLUSTER command. There is no other source of assigning the EATTR value for a VVDS DEFINE.

Attention: IBM® does not recommend doing a delete and define for the same data set inside a single step, or even in the same job, with DFSMStvs. The delete throws up an exclusive ENQ that is not released until the job terminates. This is not a problem most of the time because the job owns the ENQ, so it has no trouble allocating the data set. If, however, the unit of recovery ended up in backout for any reason, DFSMStvs would be unable to allocate the data set, and the UR would be shunted.
To avoid potential failures with a modal command sequence in your IDCAMS job:
  • Specify the data set name instead of the DD name; or
  • Use a separate job step to perform any sequence of commands (for example, REPRO, IMPORT, BLDINDEX, PRINT, or EXAMINE) that follow a DEFINE command.

Recommendation: DB2® uses Access Method Services DEFINE CLUSTER for STOGROUP defined data sets. This can result in performance problems for partitioned table spaces if multiple partitions are defined on the same volume. DB2 uses software striping on partitioned table spaces to improve performance of sequential queries. The throughput is then gated by the data delivery capability of each volume. Since each partition is a separate data set, this problem can be avoided by allocating all the partitions in a single JCL step in an IEFBR14 (not IDCAMS) job. See z/OS DFSMS Using Data Sets for details. Allocating all the partitions in this manner works if there are adequate number of volumes available with the requested space quantity in a single SMS storage group to satisfy all the partitions.

Restriction: If you specify IMBED, KEYRANGE, ORDERED, or REPLICATE it will be ignored.