RRDS (Relative Record Data Set) is a VSAM dataset type in which records are stored in fixed (or variable) slots and addressed by Relative Record Number (RRN)—slot 1, 2, 3, and so on. BDAM (Basic Direct Access Method) is an older access method that allows direct read or write of a block at a given block number or address, with no key and no required sequential order. Both give you position-based direct access without a key. RRDS has largely superseded BDAM for this kind of access on the mainframe. This page explains the similarities and differences and when you would use RRDS (or encounter BDAM in legacy contexts).
RRDS is a VSAM cluster type. You define it with IDCAMS DEFINE CLUSTER with NUMBERED. Records are stored in slots; each slot has a Relative Record Number (RRN). The first slot is RRN 1, the second RRN 2, and so on. In fixed-length RRDS, every slot is the same size (RECORDSIZE). In variable-length RRDS (VRRDS), slots can hold records of different lengths. You can read a record by RRN (direct), read sequentially (slot 1, 2, 3…), or position by RRN and then read sequentially (skip-sequential). You can insert into an empty slot and delete from a slot, freeing it for reuse. RRDS has only a data component (no index component like KSDS); the RRN is the address.
BDAM (Basic Direct Access Method) is an older IBM access method for direct access by block. The program reads or writes a block at a specific relative block number (or similar address) without reading preceding blocks. There is no key and no built-in record structure; the program is responsible for how data is organized within blocks. BDAM was often used with a hash algorithm: hash the key to get a block number, then read or write that block. It was flexible but low-level. On current z/OS, BDAM is largely obsolete; VSAM RRDS (and KSDS or databases) are used instead for position-based or key-based direct access.
| Aspect | Detail |
|---|---|
| Direct access by position | Neither requires a key; you specify a position (RRN or block) and read/write there |
| No sequential scan for random read | You can go straight to a given record or block without reading from the start |
| Pre-allocated space | RRDS has fixed slots; BDAM files are often preformatted so every block is available |
| Hash-friendly | Both can be used with a hash: hash key → position (RRN or block number) |
So both are "go to position X and read or write"—no key, no sequential scan required for that access. That makes them suitable for hash-based or slot-based designs where the application computes the position (RRN or block number) from an identifier.
| Aspect | RRDS | BDAM |
|---|---|---|
| Access by | Relative Record Number (RRN): slot 1, 2, 3, ... | Relative block number or address |
| Structure | Slots in control intervals; fixed or variable slot (VRRDS) | Unstructured blocks; program decides block layout |
| Key required | No; RRN is the position | No; block number or hash |
| Creation | IDCAMS DEFINE CLUSTER NUMBERED | JCL allocation; program formats blocks |
| Catalog | VSAM catalog (ICF) | Standard catalog or uncataloged |
| Insert/delete | Insert into empty slot; delete frees slot | Program manages block contents |
| Use today | Current VSAM type; supported | Largely obsolete; legacy or special cases |
RRDS is a full VSAM type: cataloged, with control intervals and slot management. BDAM is block-oriented and unstructured; the program manages block layout and allocation. RRDS insert and delete are at the slot level (VSAM finds an empty slot or frees one); with BDAM the program had to manage block contents and any overflow or chaining. So RRDS gives you position-based access with modern VSAM structure and tooling; BDAM was the older, more manual way to get direct access by block.
RRDS provides the same fundamental capability—direct access by position—but within the VSAM framework. You get the VSAM catalog, IDCAMS (define, repro, listcat), control intervals and buffering, and consistent JCL (DD DSN=cluster, DISP=SHR). You don’t have to pre-format blocks by hand or manage overflow in the application. For new development that needs slot-based or position-based direct access, RRDS is the standard choice. BDAM is still present in the system for compatibility, but new files are not typically defined as BDAM.
| Advantage | Detail |
|---|---|
| VSAM catalog and tools | RRDS is cataloged; LISTCAT, REPRO, IDCAMS work |
| Slot management | VSAM manages slots; insert finds empty slot, delete frees it |
| VRRDS for variable length | Variable-length RRDS supports different record sizes per slot |
| Control intervals | CI structure and buffering like other VSAM types |
| Supported and documented | RRDS is the current way to get position-based direct access on z/OS |
Use RRDS when you need direct access by a numeric position (RRN), when the application can map an identifier to a slot number (e.g. hash or direct mapping), and when you want fixed-length (or variable in VRRDS) slots. Examples: lookup tables by numeric ID, caches keyed by hash, or any design where "record at position N" is the natural model. If you need key-based access with a primary key, use KSDS; if you need append and RBA, use ESDS. RRDS fits the slot-based, position-based case that BDAM used to fill.
You may see BDAM in legacy system documentation, in older program logic, or in migration projects. Some vendor or in-house applications might still use BDAM datasets. Understanding BDAM helps when maintaining or migrating such systems. For new work, use RRDS (or KSDS/ESDS as appropriate) rather than BDAM.
Imagine a row of mailboxes numbered 1, 2, 3, 4…. You can go straight to mailbox 5 without opening 1 through 4. That's like RRDS: you say "give me slot 5" and the system goes there. BDAM was similar: you said "give me block 5" and the system went to that block. The difference is that RRDS has proper "mailboxes" (slots) managed by VSAM, with a catalog and tools, while BDAM was more like raw blocks that the program had to manage. Today we use the mailbox system (RRDS); the old block method (BDAM) is mostly from the past.
1. How do you address a record in an RRDS?
2. What do RRDS and BDAM have in common?
3. How do you define an RRDS?