RRDS vs BDAM

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).

What Is RRDS?

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.

What Is BDAM?

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.

Similarities: RRDS and BDAM

What RRDS and BDAM have in common
AspectDetail
Direct access by positionNeither requires a key; you specify a position (RRN or block) and read/write there
No sequential scan for random readYou can go straight to a given record or block without reading from the start
Pre-allocated spaceRRDS has fixed slots; BDAM files are often preformatted so every block is available
Hash-friendlyBoth 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.

Differences: RRDS vs BDAM

RRDS vs BDAM
AspectRRDSBDAM
Access byRelative Record Number (RRN): slot 1, 2, 3, ...Relative block number or address
StructureSlots in control intervals; fixed or variable slot (VRRDS)Unstructured blocks; program decides block layout
Key requiredNo; RRN is the positionNo; block number or hash
CreationIDCAMS DEFINE CLUSTER NUMBEREDJCL allocation; program formats blocks
CatalogVSAM catalog (ICF)Standard catalog or uncataloged
Insert/deleteInsert into empty slot; delete frees slotProgram manages block contents
Use todayCurrent VSAM type; supportedLargely 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.

Why RRDS Replaced BDAM

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.

RRDS Advantages in Practice

Why use RRDS over BDAM
AdvantageDetail
VSAM catalog and toolsRRDS is cataloged; LISTCAT, REPRO, IDCAMS work
Slot managementVSAM manages slots; insert finds empty slot, delete frees it
VRRDS for variable lengthVariable-length RRDS supports different record sizes per slot
Control intervalsCI structure and buffering like other VSAM types
Supported and documentedRRDS is the current way to get position-based direct access on z/OS

When to Use RRDS

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.

When You Might Still See BDAM

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.

Summary

  • RRDS and BDAM both provide direct access by position (RRN or block number) without a key.
  • RRDS is a VSAM type with slots, catalog, and IDCAMS; BDAM is an older block-oriented access method.
  • RRDS has largely replaced BDAM for position-based direct access on z/OS.
  • Use RRDS when you need slot-based or position-based access; define with IDCAMS NUMBERED.

Explain Like I'm Five

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.

Test Your Knowledge

Test Your Knowledge

1. How do you address a record in an RRDS?

  • By primary key
  • By Relative Record Number (RRN)
  • By RBA only
  • By alternate key

2. What do RRDS and BDAM have in common?

  • Both require a key
  • Both allow direct access by position (no key)
  • Both are key-sequenced
  • Both are on tape

3. How do you define an RRDS?

  • JCL DD with SPACE
  • IDCAMS DEFINE CLUSTER with NUMBERED
  • DEFINE with INDEXED
  • BSAM only
Published
Updated
Read time4 min
AuthorMainframeMaster
Reviewed by MainframeMaster teamVerified: IBM z/OS 2.5 documentationSources: IBM DFSMS Access Method Services, z/OS VSAM documentationApplies to: z/OS 2.5