Compaq COBOL AAQ2G1FTK User Manual

Page 193

Advertising
background image

Processing Files and Records

6.1 Defining Files and Records

Stream

Stream files contain records of different length, delimited by a record terminator.

The compiler generates a stream record formatted file when you use the
ORGANIZATION IS LINE SEQUENTIAL clause in the File-Control Division.
This record format is useful for files created by text editors.

On OpenVMS, a stream file will also be generated under certain situations if
you compiled /NOVFC. See the section in this book that describes print-control
records for more information.

6.1.3 File Design

The difficulty of design is proportional to the complexity of the file organization.
Before you create your sequential, relative, or indexed file applications, you
should design your files based on these design considerations:

Record format—For relative files (see Section 6.1.2)

Relative files can contain either fixed-length records or variable-length
records. However, the I/O system calculates a cell size equal to the maximum
record size plus overhead bytes, resulting in fixed-length storage for
relative files (see the Relative File Organization section in Section 6.1.1).
Once created, relative records can be accessed sequentially, randomly, or
dynamically.

Storage Medium

You can access sequential, relative, and indexed files on disk. Be careful to
use a disk pack that is large enough to meet your current and future needs.
You can also access sequential files, unlike relative and indexed files, on
magnetic tape and unit record devices (for example, on printers and card
readers).

Allocation (see Chapter 15)

On OpenVMS, you can optimize data storage at the time of file creation and
file extension.

Bucket size—For relative files (see the Relative File Organization section in
Section 6.1.1)

You can optimize the packing of cells into buckets by ensuring that the cell
size is evenly divisible into the bucket size.

Maximum number of records—For relative files (see the Relative File
Organization section in Section 6.1.1)

Key scheme—For relative files (see the Relative File Organization section in
Section 6.1.1)

Speed—For indexed files (see the Indexed File Organization section in
Section 6.1.1)

You can maximize the speed with which the program processes data.

Space—For indexed files (see the Indexed File Organization section in
Section 6.1.1)

You can minimize file size, disk space, and memory requirements to run your
program.

Shared access—For indexed files (see the Indexed File Organization section in
Section 6.1.1)

Processing Files and Records 6–13

Advertising