Processing Files and Records
6.1 Defining Files and Records
Table 6–1 (Cont.) Compaq COBOL File Organizations—Advantages and Disadvantages
File
Organizations
Advantages
Disadvantages
Provides the most flexible record
format
Allows READ/WRITE sharing
Allows data to be stored on
many types of media, in a
device-independent manner
Allows easy file extension
Line Sequential
Most efficient storage format
Allows sequential access only
Compatible with text editors
Used for printable characters only
Open Mode I/O is not allowed
Relative
Allows sequential, random, and
dynamic access
Allows data to be stored on disk only
Provides random record deletion
and insertion
Requires that record cells be the same size
Allows READ/WRITE sharing
Indexed
Allows sequential, random, and
dynamic access
Allows data to be stored on disk only
Allows random record deletion
and insertion on the basis of a
user-supplied key
Requires more disk space
Allows READ/WRITE sharing
Uses more memory to process records
Allows variable-length records to
change length on update
Generally requires multiple disk accesses to
randomly process a record
Allows easy file extension
Sequential File Organization
Sequential input/output, in which records are written and read in sequence, is
the simplest and most common form of I/O. It can be performed on all I/O devices,
including magnetic tape, disk, terminals, and line printers.
Sequential files consist of records that are arranged in the order in which they
were written to the file. Figure 6–1 illustrates sequential file organization.
Figure 6–1 Sequential File Organization
RECORD
3
End of file
RECORD
(n−1)
...
ZK−6055−GE
RECORD
1
RECORD
2
Beginning of file
RECORD
n
Processing Files and Records 6–3
Содержание COBOL AAQ2G1FTK
Страница 22: ......
Страница 30: ......
Страница 94: ......
Страница 110: ......
Страница 146: ......
Страница 180: ......
Страница 194: ...Processing Files and Records 6 1 Defi...
Страница 300: ......
Страница 490: ......
Страница 516: ......
Страница 517: ......
Страница 530: ......
Страница 534: ......
Страница 590: ......
Страница 620: ......