The Indexed file in COBOL
FORTRAN had direct file access that allowed you to move to the n’th record. COBAL had indexed file access that allowed you to move to the record containing key k. This was the precursor of the database.
IBM created a programming language called PL/I that was a bit of a merger of FORTRAN and COBOL that also supported indexed files. For many years, PL/I was the most popular programming language for teaching introductory computer science.
- COLOB-85 tutorial on index-sequential files
- PL/I Indexed Record I/O
- PL/I Programming Guide (chapter 9)
ISAM and VSAM
The foundation of keyed-file access on the IBM mainframes was ISAM, Indexed Sequential Access Method, and its replacement VSAM, Virtual Storage Access Method. (VSAM also replaced BDAM.) VSAM continues to be used in many applications and ISAM-like interfaces are still used to implement databases.
The B-Tree
The B-tree and its variants is one of the best known and most animated external data structures in computer science. The B-tree is used in databases and in file systems.
In most modern implementation of B-trees, internal nodes store the addresses of their child nodes and the leaf nodes store the addresses of the actual data. However, some refer to this as a B+ tree.
Historical references
- Bayer and McCreight’s “Organization and Mainenance of Large Ordered Indexes
- The Ubiquitous B-Tree by Doug Comer
File system references
An example implementation
Start with a warm-up exercise, Homework 1 of the Spring 1998 CSCI 343.
- A definition of the on-disk structure — partition of record into key and value
- C program to search the on-disk structure —
fseekandfread
Proceed to the semester-long B+ implementation assignment.
- Record definition and prototypes for functions — with an invariant
- Block I/O routines — direct access
- “Useful” routines — finding, inserting, splitting
- Updating the B+ tree — the hard part