File Organization; Compaq Cobol File Organizations-Advantages And Disadvantages - Compaq COBOL AAQ2G1FTK User Manual

Compaq computer accessories user manual
Table of Contents

Advertisement

Processing Files and Records
6.1 Defining Files and Records
A record is a group of related data elements. The space a record needs on
a physical device depends on the file organization, the record format, and the
number of bytes the record contains.
File organization is described in Section 6.1.1. Record format is described in
Section 6.1.2.

6.1.1 File Organization

Compaq COBOL supports the following four types of file organization:
SEQUENTIAL—This organization requires that records be referenced in
sequence from the first record to the last. This organization is useful for
programs that normally access each record serially. (See the Sequential File
Organization section in this chapter.)
LINE SEQUENTIAL— This organization is essentially the same as
sequential. Line sequential allows you to treat files as collections of variable
length records, with each record containing one line of printable characters.
This organization is useful for programs that access files created by text
editors and similar programs. (See the Line Sequential File Organization
section in this chapter.)
RELATIVE—This organization lets you access records randomly, or
sequentially by record number values. While this organization is more flexible
than sequential organization, it is less flexible than indexed organization
because you cannot insert a record in the middle of your file unless you have
an empty cell to contain it. (See the Relative File Organization section in this
chapter.)
INDEXED—This organization lets you access records randomly or
sequentially, by primary and alternate key values. This is a useful way
to organize a file in which records will be added, changed, or deleted upon
demand. (See the Indexed File Organization section in this chapter.)
On Tru64 UNIX, a third-party product is required for INDEXED runtime
support. See the Read Before Installing . . . letter for up-to-date details
on how to obtain the INDEXED runtime support.
Table 6–1 summarizes the advantages and disadvantages of these file
organizations.
Table 6–1 Compaq COBOL File Organizations—Advantages and Disadvantages
File
Organizations
Advantages
Sequential
Uses disk and memory efficiently
Provides optimal usage if the
application accesses all records
sequentially on each run
6–2 Processing Files and Records
Note
Disadvantages
Allows sequential access only
Allows records to be added only to the end of a file
(continued on next page)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COBOL AAQ2G1FTK and is the answer not in the manual?

Table of Contents