This page is a full syntax reference for the IDCAMS DEFINE CLUSTER command. It lists every major parameter you can use when defining a VSAM cluster (KSDS, ESDS, RRDS, or LDS), what each parameter does, how it affects the cluster, and where it can be specified. Use it alongside the DEFINE CLUSTER overview page when you need the complete picture—required vs optional parameters, space allocation options, record and key attributes, sharing and catalog options, and the DATA and INDEX subparameters.
DEFINE CLUSTER has many parameters. Some are required (NAME, organization, RECORDSIZE, space; KEYS for KSDS). Others control space (CYLINDERS, TRACKS, RECORDS, FREESPACE), sharing (SHAREOPTIONS), placement (VOLUMES), security (READPW, UPDATEPW), retention (FOR, TO), and component names (DATA, INDEX). A full reference helps you choose the right combination and avoid mistakes. For example, RECORDSIZE and KEYS cannot be changed after the cluster is defined; getting them right the first time matters. Similarly, FREESPACE affects how often VSAM splits control intervals and control areas when you insert records, so understanding the syntax helps you set it correctly.
The command has this general shape. Cluster-level parameters come first, then optionally the DATA(...) clause, and for KSDS the INDEX(...) clause. Continuation is with a hyphen at end of line. Parameters can be in any order within their section.
12345678910111213141516171819DEFINE CLUSTER ( - NAME(cluster-name) - INDEXED | NONINDEXED | NUMBERED | LINEAR - RECORDSIZE(min max) - [ KEYS(length offset) ] /* required for INDEXED */ - [ FREESPACE(ci-percent ca-percent) ] - CYLINDERS(primary [secondary]) | TRACKS(primary [secondary]) | RECORDS(primary [secondary]) - [ SHAREOPTIONS(cross-region cross-system) ] - [ VOLUMES(volser [...]) ] - [ BUFFERSPACE(n) ] - [ REUSE | NOREUSE ] - [ UNIQUEKEY | NONUNIQUEKEY ] /* KSDS only */ - [ CATALOG(catname[/password]) ] - [ READPW(pwd) ] [ UPDATEPW(pwd) ] - [ FOR(days) | TO(date) ] - [ other... ] ) - [ DATA ( [ NAME(...) ] [ CISZ(...) ] [ space ] [ VOLUMES(...) ] ... ) ] - [ INDEX ( [ NAME(...) ] [ CISZ(...) ] [ space ] [ VOLUMES(...) ] ... ) ] /* KSDS only */
You must specify the cluster name, the organization type, record size, and space. For a KSDS you must also specify the key. Everything else has defaults or is optional.
| Parameter | Description |
|---|---|
| NAME(cluster-name) | The 1- to 44-character name of the cluster. This is the name used in JCL DSN= and in application programs. Required. Must follow TSO naming rules. |
| INDEXED | NONINDEXED | NUMBERED | LINEAR | Exactly one required. INDEXED = KSDS (keyed, with index). NONINDEXED = ESDS (entry-sequenced). NUMBERED = RRDS (relative record). LINEAR = LDS (byte-addressable, no record structure). |
| RECORDSIZE(min max) | Minimum and maximum record length in bytes. For fixed-length records use the same value twice, e.g. RECORDSIZE(80 80). For variable-length, e.g. RECORDSIZE(50 500). Cannot be changed after define. |
| KEYS(length offset) | Required for INDEXED (KSDS) only. Length = key length in bytes; offset = byte position of first key byte (0-based). E.g. KEYS(10 0) = 10-byte key at start of record. Must fit within record. Cannot be changed after define. |
| CYLINDERS(p sec) | TRACKS(p sec) | RECORDS(p sec) | Space allocation. Primary (p) = initial allocation; secondary (sec) = amount per extension. At least one of these is required. Can be at cluster level or in DATA/INDEX. |
Space can be specified at the cluster level (applies to the whole cluster; for a KSDS the system divides it between data and index) or inside DATA(...) and INDEX(...) for separate control. You use one of CYLINDERS, TRACKS, or RECORDS. Primary is the initial allocation; secondary is the amount added each time the dataset is extended. If you omit secondary, behavior is system-dependent (some systems allow no extension).
| Parameter | Description |
|---|---|
| CYLINDERS(primary [secondary]) | Allocate in cylinders. One cylinder is device-dependent (e.g. 15 tracks on 3390). Use for large datasets. Primary and secondary are whole numbers. |
| TRACKS(primary [secondary]) | Allocate in tracks. One track is typically about 56 KB on a 3390. Use for smaller datasets or when you need finer control than cylinders. |
| RECORDS(primary [secondary]) | Space derived from record count. System converts to tracks/cylinders using RECORDSIZE and CI size. Use when you think in terms of number of records. |
| BLOCKS(primary [secondary]) | Allocate in blocks (physical blocks). Less common than CYLINDERS/TRACKS/RECORDS. Block size is device-dependent. |
CYLINDERS is typical for large production files. TRACKS is useful for smaller files or when you need finer granularity than a full cylinder. RECORDS is useful when you want to express allocation in terms of how many records you expect; the system converts to tracks/cylinders using RECORDSIZE and control interval size. You can specify different space in DATA and INDEX for a KSDS—for example DATA CYLINDERS(100 50) and INDEX CYLINDERS(2 1)—so the index does not take space from the data component.
FREESPACE(ci-percent ca-percent) reserves a percentage of each control interval and each control area for inserts. It applies to KSDS and RRDS. The first value is the percentage of each CI left free; the second is the percentage of each CA left as free CIs. For example FREESPACE(20 10) reserves 20% of each CI and 10% of each CA. Higher values reduce how often VSAM must split CIs and CAs when you insert records, but they also mean less data per CI (more I/O for full sequential scans). ESDS does not use FREESPACE in the same way because it only appends; LDS has no record structure. If you omit FREESPACE, the default is often (0 0), which can lead to many splits in a growing KSDS.
RECORDSIZE and KEYS define the record layout. These cannot be changed after the cluster is defined. UNIQUEKEY/NONUNIQUEKEY and REUSE/NOREUSE control key behavior and whether the cluster can be reused without delete/redefine.
| Parameter | Description |
|---|---|
| RECORDSIZE(min max) | Min and max record length in bytes. Fixed-length: use same value (e.g. 80 80). Variable: use range (e.g. 100 500). Record length cannot exceed max; for variable-length records the actual length is stored in a prefix. |
| KEYS(length offset) | KSDS only. Length = key length (1–255 bytes). Offset = position of key in record (0-based). Key must be entirely within the record. Often key is at offset 0. Determines how records are ordered and accessed. |
| UNIQUEKEY | NONUNIQUEKEY | KSDS only. UNIQUEKEY (default): duplicate keys are not allowed. NONUNIQUEKEY: duplicate keys are allowed; records with the same key are stored in RBA order. Affects insert behavior and key search. |
| REUSE | NOREUSE | REUSE: cluster can be opened for output and overwritten (e.g. reloaded) without deleting and redefining. NOREUSE (default): cluster cannot be reused; must delete and redefine to start fresh. REUSE is useful for work files that are reloaded each run. |
For RECORDSIZE, fixed-length records are the norm for KSDS and RRDS (e.g. RECORDSIZE(80 80)). Variable-length records use a range (e.g. RECORDSIZE(100 500)); the actual length is stored in a prefix. For KEYS, the offset is 0-based: KEYS(10 0) means the key starts at the first byte of the record. The key must lie entirely within the record (offset + length ≤ record length). UNIQUEKEY means no two records can have the same key; NONUNIQUEKEY allows duplicates, and retrieval by key returns records in RBA order.
| Parameter | Description |
|---|---|
| SHAREOPTIONS(cross-region cross-system) | Controls how the cluster can be shared. Cross-region: (1)=read-only shared, (2)=read/write shared, (3)=exclusive. Cross-system: (3)=same across systems. Common: (2 3) for batch read/write sharing. (3 3) = no sharing. |
| VOLUMES(volser [volser...]) | DASD volume serial(s) where the cluster is allocated. Omit if SMS manages placement. Use when you must place the dataset on specific volumes (e.g. for performance or policy). |
| BUFFERSPACE(n) | Suggests buffer space in bytes for the cluster. Can affect how much buffer pool is used at open. Often omitted; system chooses default. Used for performance tuning. |
SHAREOPTIONS(cross-region cross-system) controls whether multiple address spaces or systems can open the cluster and whether they can update it. (1 3) allows read-only sharing; (2 3) allows read/write sharing and is common for batch; (3 3) means no sharing (exclusive). VOLUMES is used when you need the cluster on specific DASD volumes; omit it when SMS or the system chooses the volume. BUFFERSPACE is a hint for buffer allocation; many installations leave it omitted.
| Parameter | Description |
|---|---|
| CATALOG(catalog-name[/password]) | User catalog (and optional password) where the cluster is to be cataloged. Omit to use the step or job catalog. Required only when catalog is not the default. |
| READPW(password) | Read password. Anyone opening the cluster for read must supply this password. Omit for no read password. Used for basic access control. |
| UPDATEPW(password) | Update password. Required for open for update (read/write). Omit for no update password. Different from read password so you can allow read-only access without update. |
| FOR(days) | TO(date) | Retention. FOR(days): retain for that many days from creation. TO(date): retain until that date. Prevents accidental delete before retention; use PURGE on DELETE to override. |
CATALOG is needed only when the cluster is to be cataloged in a user catalog that is not the default. READPW and UPDATEPW provide simple password protection; without the correct password, open fails. FOR and TO set retention; DELETE without PURGE will not remove the object until the retention period has passed.
The DATA(...) clause applies to the data component; the INDEX(...) clause applies to the index component (KSDS only). Inside them you can override or supply component-specific attributes. Common subparameters are NAME (component name), space (CYLINDERS, TRACKS, RECORDS), CISZ (control interval size), and VOLUMES.
| Subparameter | Description |
|---|---|
| NAME(component-name) | Explicit name for the data or index component. If omitted, default is cluster-name.DATA and cluster-name.INDEX. Use for naming standards or to identify components in LISTCAT. |
| CYLINDERS / TRACKS / RECORDS | Space for this component only. In DATA(...) applies to data component; in INDEX(...) applies to index component. For KSDS, index is usually much smaller; e.g. INDEX(NAME(...) CYLINDERS(2 1)). |
| CISZ(n) | Control interval size in bytes (in DATA or INDEX). Allowed values depend on record size and device. Larger CI = more data per I/O but more waste on partial CI reads. Omit for default. |
| VOLUMES(volser...) | Volume(s) for this component. Can differ from cluster-level VOLUMES if you want data and index on different volumes (rare). |
If you omit the DATA and INDEX clauses, IDCAMS generates default component names (cluster-name.DATA and cluster-name.INDEX). Specifying NAME(...) inside DATA and INDEX lets you control those names. Specifying space inside DATA and INDEX lets you allocate different amounts to data and index, which is recommended for KSDS so the index does not consume more space than it needs.
This example uses many of the parameters discussed above: NAME, INDEXED, RECORDSIZE, KEYS, FREESPACE, space at DATA and INDEX, SHAREOPTIONS, REUSE, and explicit DATA and INDEX names.
12345678910111213141516171819DEFINE CLUSTER ( - NAME(MY.APPL.PROD.KSDS) - INDEXED - RECORDSIZE(200 200) - KEYS(20 0) - UNIQUEKEY - FREESPACE(20 10) - SHAREOPTIONS(2 3) - REUSE - VOLUMES(MYVOL1) - FOR(30)) - DATA ( - NAME(MY.APPL.PROD.KSDS.DATA) - CYLINDERS(50 25) - CISZ(4096)) - INDEX ( - NAME(MY.APPL.PROD.KSDS.INDEX) - CYLINDERS(2 1))
The cluster is a KSDS with 200-byte fixed records and a 20-byte unique key at offset 0. FREESPACE(20 10) reserves 20% of each CI and 10% of each CA. SHAREOPTIONS(2 3) allows read/write sharing. REUSE allows the file to be reloaded without delete/redefine. The data component gets 50 cylinders primary and 25 secondary with 4 KB CIs; the index gets 2 cylinders primary and 1 secondary. Retention is 30 days.
Parameters can appear in any order within the DEFINE CLUSTER parentheses and within the DATA and INDEX clauses. IDCAMS parses by keyword, not position. Some parameters have defaults: NOREUSE, UNIQUEKEY, SHAREOPTIONS often defaults to (2 3) or (1 3) depending on the environment, and FREESPACE defaults to (0 0) if omitted. If you omit the DATA and INDEX clauses entirely, the cluster is still created with default component names and space is taken from the cluster-level allocation. For a KSDS, that space is divided between data and index; the split is system-determined and may not match what you want, so specifying DATA and INDEX with explicit space is recommended for production.
RECORDSIZE, KEYS (length and offset), and the organization type (INDEXED, NONINDEXED, NUMBERED, LINEAR) are fixed at define time. The ALTER command can change many attributes—FREESPACE, SHAREOPTIONS, some space and buffer settings—but it cannot change record size, key definition, or organization. To change those you must define a new cluster with the desired attributes and copy the data (e.g. with REPRO) from the old cluster to the new one, then switch applications to the new name and optionally delete the old cluster.
DEFINE CLUSTER is like filling out an order form for a new filing system. You have to say what it's called (NAME), what kind it is (with keys, or in order, or numbered drawers, or just a big box), how big each folder is (RECORDSIZE), and how much space you want (CYLINDERS or TRACKS). If it's the kind with keys, you have to say how long the key is and where it is (KEYS). Then you can add extra options: how much empty space to leave for new folders (FREESPACE), who can use it at the same time (SHAREOPTIONS), and whether you can wipe it and reuse it without throwing it away (REUSE). The full syntax reference is the complete list of every box you can fill on that form.
1. Which parameter is required for a KSDS but not for an ESDS?
2. What does REUSE do?
3. Where do you specify the index component space for a KSDS?