6 i/o operations – Compaq COBOL AAQ2G1FTK User Manual

Page 500

Advertising
background image

Optimizing Your Compaq COBOL Program
15.5 Choices in Procedure Division Statements

15.5.5 Minimizing USE Procedures with LINKAGE SECTION References

Compaq COBOL can perform certain optimizations if a program unit does
not contain USE procedures that reference LINKAGE SECTION items. Note
that USE procedures implicitly reference the following variables for any files
associated with the USE procedures:

FILE STATUS
DEPENDING ON
RELATIVE KEY
LINAGE-COUNTER
Record buffer

If you need to reference LINKAGE SECTION items in a USE procedure, try
to limit the size of the program unit containing that USE procedure. Compaq
COBOL will be able to perform more aggressive optimizations on all the other
program units that do not contain the LINKAGE SECTION references in any
USE procedures.

15.6 I/O Operations

Compaq COBOL provides methods of controlling actions taken by the I/O system
during I/O operations. You have the choice of accepting the defaults the I/O
system provides or using these optional methods to make your program more
efficient.

The Compaq COBOL language elements that can specify alternatives to the I/O
system defaults are as follows:

The APPLY clause in the I-O-CONTROL paragraph

The RESERVE n AREAS clause in the FILE-CONTROL paragraph

The SAME RECORD AREA clause in the I-O-CONTROL paragraph

The BLOCK CONTAINS clause in the FD entry

On OpenVMS, for additional information on the RMS terms and concepts
included in this section, see the OpenVMS Record Management Utilities Reference
Manual
and the OpenVMS Record Management Services Reference Manual.

15.6.1 Using the APPLY Clause

On OpenVMS, the APPLY clause in the I-O-CONTROL paragraph of the
Environment Division provides phrases that you can use to improve I/O
processing. Examine the following example of the APPLY clause:

APPLY



CONTIGUOUS
CONTIGUOUS-BEST-TRY



PREALLOCATION preall-amt ON { file-name } ...

15.6.1.1 Using the PREALLOCATION Phrase of the APPLY Clause

By default, the system does not preallocate disk blocks. As a result, files
can require multiple extensions of disk blocks. Although file extension is
transparent to your program, it can reduce performance. To avoid a degradation
in performance, use the APPLY PREALLOCATION clause to preallocate disk
blocks.

15–10 Optimizing Your Compaq COBOL Program

Advertising