Optimizing YourCompaq COBOL Program
15.6 I/O Operations
15.6.3 Sharing Record Areas
The compiler allocates unique storage space in the Data Division for each file’s
current record area. Transferring records between files requires an intermediate
buffer area and adds to a program’s processing requirements.
To reduce address space and processing overhead, files can share current record
areas. Specify the SAME RECORD AREA clause in the I-O-CONTROL paragraph
of the Environment Division. Records need not be the same size, nor must the
maximum size of each current record area be the same.
Figure 15–1 shows the effect of current record area sharing in a program that
reads records from one file and writes them to another. However, it also shows
a drawback: current record area sharing is equivalent to implicit redefinition.
The records do not exist separately. Therefore, if the program changes a record
defined for the output file, the input file record is no longer available.
Optimizing YourCompaq COBOL Program 1513