VSAMbeginner
VSAM ESDS: Entry-Sequenced Data Sets
Understand ESDS as a VSAM organization for append-only, physical-order storage referenced by relative byte address.
An ESDS stores records in the order they were written. There is no index and no key-based lookup.
An ESDS is a ship's logbook — every entry gets written on the next blank line in the order it happens, you can always read it start to finish in that same order, and you can correct a specific past entry if you know exactly which line it's on, but you'd never reorder the pages or expect to look up an entry by any key other than knowing roughly when it happened.
Key Concepts
1
It is VSAM's equivalent of a sequential file, and choosing it deliberately — rather than defaulting to KSDS
— is what the question is checking.
2
Records are addressed by position in bytes. The RBA (relative byte address) is the offset from the start
of the dataset:
3
record 1 at RBA 0
record 2 at RBA 200
record 3 at RBA 4004
To find a particular record you either scan from the beginning or already know its RBA.
5
Knowing the RBA in advance is the usual pattern. When a record is written, VSAM returns its RBA. Store
that somewhere — often in a KSDS keyed by something meaningful — and later reads go straight to it.
6
KSDS: customer C0001 -> detail RBA 84200
ESDS: the detail record at RBA 842007
So the KSDS provides the lookup and the ESDS provides append-only storage.
8
Append-only is the defining property, and it is a feature rather than a limitation. Records can be
rewritten in place if you know the RBA. They cannot be deleted, and they cannot move.
9
A record's position never changes once written.
10
That makes it the natural fit for a log. An audit trail, a transaction journal, an event history:
written once, in order, never amended, read forward later.
11
An index on such a file would cost maintenance on every write and give nothing, because nobody looks a log
record up by key — they replay it in order.
12
The other use is as a base cluster beneath an alternate index, where the alternate index supplies the
lookup the ESDS itself cannot.
13
In COBOL it is handled as ORGANIZATION IS SEQUENTIAL when used purely as append-and-read-forward.
ORGANIZATION IS SEQUENTIAL
14
The comparison to state in an interview.
KSDS ordered by key, index maintained, direct lookup,
records can be deleted
ESDS ordered by arrival, no index, no key lookup,
records never move or disappear15
Choose ESDS when records are naturally processed in the order they happened and nothing needs to find one
by a business key. Its immutability is exactly why it suits an audit log.
16
What the interviewer is probing.1. "How are records addressed in an ESDS?" Probing: the model. Stalls: "By key." Moves up:
by relative byte address, in the order they were written — there is no key sequencing.
17
2. "What is an ESDS good for?" Probing: the fit. Stalls: "Everything." Moves up:
append-only data such as a log or journal, where records are written in order and read sequentially.
18
3. "Can you delete a record from an ESDS?" Probing: the limitation. Stalls: "Yes." *Moves
up:* no — you can only update in place with the same length, which is why a deletion flag is the
usual workaround.
19
4. "How would you get keyed access to one?" Probing: the technique. Stalls: "You cannot."
Moves up: an alternate index over the ESDS, which gives a path by a field without changing the
base organisation.