Chapter 15. Indexed and Relative File Processing

OBJECTIVES

To familiarize you with

  1. Methods of disk file organization.

  2. Random processing of disk files.

  3. How to create, update, and access indexed disk files.

  4. How to create, update, and access relative files.

  5. Methods used for organizing relative files.

SYSTEMS CONSIDERATIONS FOR ORGANIZING DISK FILES

Recall that the term file refers to a collection of records to be used for a given application. An accounts receivable file, for example, is the collection of all customer records. We now discuss the major ways in which files can be stored or organized on a disk storage unit.

Sequential File Organization

The simplest type of disk file organization is sequential. Sequential files are processed in the same way regardless of the type of magnetic media on which they are stored. Typically, the records to be stored in a sequential file are first sorted into sequence by a key field such as customer number, part number, or employee number. It is then relatively easy to locate a given record. The record with employee number 00986, for example, would be physically located between records with employee numbers 00985 and 00987. To access that record, the computer must read past the first 985 records.

We have already seen in Chapter 13 how a master sequential file can be updated by either (1) creating a new master file using the previous master and the transaction file of changes as input or (2) rewriting master records that have changes.

There are two methods ...

Get COBOL for the 21st Century now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.