A batch program needs to retrieve a customer by account key, a log reader needs records in load order, and a relative file needs direct access to slot 250. Those are three different access patterns, and they point to different VSAM organizations. This reference compares the structural characteristics of the five VSAM data set types—KSDS, ESDS, fixed-length RRDS, VRRDS, and LDS—so you can see exactly how records are ordered, addressed, inserted, deleted, and stored.
VSAM data set types at a glance
VSAM concepts begin with a simple distinction: an organization defines how data is arranged and how an application identifies it. A KSDS uses a key and an index. An ESDS uses entry sequence and a relative byte address (RBA). An RRDS uses a relative record number (RRN). An LDS exposes byte-addressable storage rather than application records.
This page is a characteristics reference, not a workload recommendation page. If your question is which organization fits a particular application, use the separate VSAM data set selection guide after comparing the mechanics here.
VSAM organization comparison table
| Characteristic | KSDS | ESDS | Fixed RRDS | VRRDS | LDS |
|---|---|---|---|---|---|
| Logical order | Ascending prime-key sequence | Order in which records are loaded | RRN sequence | RRN sequence | No record order |
| Direct identifier | Prime key or RBA | RBA | RRN | RRN | Byte offset through data-in-virtual services |
| Components | Data plus prime index | Data only | Data only | Data plus index | Data only |
| Alternate index | Permitted | Permitted by VSAM, with language/product restrictions | Not permitted | Not permitted | Not permitted |
| Identifier stability | Key stable; RBA can change | RBA remains stable | RRN remains stable | RRN remains stable | Not record-addressed |
| Insertion | In key sequence; free space can accommodate growth | Append at the logical end | Into an empty numbered slot | At an unused RRN; free space supports variable lengths | Managed as byte-addressable pages |
| Deletion and reuse | Released space becomes reusable | Deletion does not create general reusable free space; a same-length record can replace the deleted record | Deleted slot can be reused | Released space becomes reusable | No record-level delete operation |
| Record length | Fixed or variable | Fixed or variable | Fixed | Variable | No VSAM record structure |
| Spanned records | Allowed | Allowed | Not allowed | Not allowed | Not applicable |
| Extended format | Supported | Supported | Supported | Supported | Supported |
KSDS characteristics
A key-sequenced data set stores records in the collating sequence of a unique prime key. Its separate prime-index component maps keys to data control intervals, which makes keyed direct access possible while preserving logical key order for sequential processing. Applications can also address records by RBA, but that RBA is not a permanent identifier: control interval and control area splits can move a record.
KSDS supports fixed- or variable-length records, record insertion in key sequence, deletion, and reusable free space. It also permits alternate indexes for access through additional keys. These features explain the extra index component and the additional maintenance compared with a data-only organization.
ESDS characteristics
An entry-sequenced data set keeps records in arrival order. New records are appended to the logical end, and an RBA identifies the byte position of an existing record. Because records are not reorganized by a key index, the RBA remains stable. Sequential reading follows load order.
ESDS supports fixed- or variable-length records and can have an alternate index at the VSAM level. Its update rules are stricter than KSDS rules: a record cannot grow in place, and normal deletion does not turn arbitrary space into reusable free space. A deleted record location can be reused by a replacement of the same length. Those constraints make ESDS behavior distinct from merely calling it “a file without a key.”
Fixed-length RRDS characteristics
A fixed-length relative record data set divides storage into equal-length slots. The RRN identifies a slot, so record 250 is reached by relative number rather than by scanning 249 earlier records. Empty slots can exist, and deleting a record makes that numbered slot available for reuse without changing the RRNs of other records.
Because every slot has the same size, a fixed RRDS does not need an index component. It does not support alternate indexes or spanned records. In COBOL terms, this organization aligns with relative file organization when fixed record length and stable relative numbers fit the application contract.
VRRDS characteristics
A variable-length RRDS also addresses records by RRN, but an index maps those relative numbers to variable-length records in the data component. That index is the key structural difference from fixed RRDS. Records can vary in length, and available free space can be reused after records are deleted or shortened.
VRRDS retains stable RRNs, does not permit alternate indexes, and does not allow records to span control intervals. It is therefore not simply a fixed RRDS with a larger maximum record size; its indexed layout supports the variable-length mapping.
LDS characteristics
A linear data set contains a continuous string of bytes with no VSAM-defined record boundaries. Programs use data-in-virtual (DIV) services and window services to map and access its pages. Record-level concepts such as prime keys, RRNs, alternate indexes, deletion, and spanning do not apply.
LDS is also excluded from VSAM record-level sharing. Treat it as a byte-addressable storage object, not as another record organization with an unusual access key.
Data and index components
The word cluster refers to the VSAM object defined in the catalog. KSDS and VRRDS require both data and index components. KSDS uses its index for the prime-key structure; VRRDS uses an index to map RRNs to variable-length records. ESDS, fixed RRDS, and LDS have only a data component unless another separately defined structure is involved.
This distinction matters during definition, backup, recovery, and space analysis. It also prevents a common mistake: assuming every organization with direct access must have an index component.
RBA, RRN, and key stability
A key, RBA, and RRN are not interchangeable names for a record address. A KSDS prime key is a logical identifier, while its RBA can change as VSAM reorganizes space. An ESDS RBA is stable because records retain their byte position. An RRDS RRN identifies a logical slot or indexed relative number and remains stable for that record location.
Practical rule: store or exchange only the identifier guaranteed by the organization and application design. Do not persist a KSDS RBA as though it were a permanent business key.
Alternate indexes and language limits
At the VSAM level, alternate indexes can be defined over KSDS and ESDS clusters, but not over either RRDS type or LDS. The programming environment can impose a narrower rule. For example, IBM Enterprise COBOL documents alternate-index support for KSDS but not for ESDS. Always check both the access-method capability and the language or transaction manager interface.
Spanned records and extended format
KSDS and ESDS records may be spanned, allowing one logical record to cross control interval boundaries when the cluster is defined accordingly. Fixed RRDS and VRRDS do not support spanning, and the concept is not applicable to LDS because LDS has no record boundaries.
All five organizations can be defined as extended-format VSAM data sets when the applicable system and storage requirements are met. Extended format enables facilities such as data striping and, for eligible KSDS data components, compression. “Extended format supported” does not mean every extended-format feature applies identically to every organization.
How DEFINE CLUSTER identifies each type
IDCAMS uses organization attributes in the cluster definition. The following skeleton shows the identifying keyword, not a complete production definition:
/* KSDS */ DEFINE CLUSTER (NAME(...) INDEXED ...)
/* ESDS */ DEFINE CLUSTER (NAME(...) NONINDEXED ...)
/* RRDS */ DEFINE CLUSTER (NAME(...) NUMBERED RECORDSIZE(80 80) ...)
/* VRRDS */ DEFINE CLUSTER (NAME(...) NUMBERED RECORDSIZE(80 400) ...)
/* LDS */ DEFINE CLUSTER (NAME(...) LINEAR ...)
For NUMBERED, equal average and maximum record sizes describe fixed RRDS; unequal values describe VRRDS. The exact space, sharing, buffer, key, and data class parameters depend on the workload and installation standards. See the full DEFINE CLUSTER guide and the related IDCAMS command reference for working examples.
Common VSAM comparison mistakes
- Calling every direct identifier a key: ESDS uses an RBA, RRDS uses an RRN, and LDS is byte-addressable.
- Treating ESDS deletion like KSDS deletion: ESDS does not provide the same general free-space reuse behavior.
- Combining fixed RRDS and VRRDS: both use RRNs, but only VRRDS has an index component and variable record lengths.
- Assuming an RBA is always stable: it is stable for ESDS but can change for a KSDS record.
- Equating VSAM support with language support: alternate-index restrictions can differ between VSAM itself and a language such as COBOL.
Official IBM references
- Summary of VSAM data set types
- VSAM data set organizations
- Selection of VSAM data set types
- Enterprise COBOL support for VSAM files
- Extended-format VSAM data sets
- IDCAMS DEFINE CLUSTER
- Fixed-length RRDS
- Creating a linear data set
VSAM data set types FAQ
Which VSAM data set types have an index component?
KSDS and VRRDS have index components. A KSDS index supports prime-key access; a VRRDS index maps RRNs to variable-length records. ESDS, fixed RRDS, and LDS are data-only organizations.
Is an ESDS RBA stable?
Yes. An ESDS record keeps its RBA because records remain in entry sequence. A KSDS RBA can change after splits or reorganization, so the prime key is the safer logical identifier.
What is the difference between RRDS and VRRDS?
Fixed RRDS uses equal-length slots and has no index component. VRRDS supports variable-length records and uses an index to map each RRN to its record. Both provide direct access by RRN.
Which VSAM types allow spanned records?
KSDS and ESDS allow spanned records when defined for them. Fixed RRDS and VRRDS do not, while spanning is not applicable to LDS because it has no VSAM record structure.
Use the matrix as a definition check. When reviewing a design or an IDCAMS definition, start with the identifier the application owns: prime key, RBA, RRN, or byte offset. Then verify component structure, record length, insertion and deletion rules, spanning, and required language support. That sequence turns the five acronyms into concrete storage behaviors and helps catch an organization mismatch before data is loaded.