COBOL Manual for TNS and TNS/R Programs

Environment Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
6-35
FILE-CONTROL Paragraph
Enscribe determines the size of the sequential block buffer. Usually, the buffer size
is the file’s data block size, but when a process accesses a file by alternate keys,
the buffer size is the alternate key file’s data block size. You can obtain the data
block size for the appropriate file with the FUP command:
FUP INFO file-name,DETAIL
The size is usually 1,024 characters.
The size of the buffer space used for reading is 4* dbs, where dbs is the file’s data
block size. The BLOCK CONTAINS clause, if specified, is ignored. Because
double buffering is used, the size of the block read is half the size of the buffer. The
maximum size of blocks read is 32,768 characters.
If the process cannot perform sequential block buffering for any reason, it performs
normal input-output. The file status code is “07”.
Buffered Cache
Buffered cache is a feature of the DP2 disk process that uses more efficient disk
I-O to write disk files.
The RESERVE clause acts as a switch. In the CRE, the number 2 means to use
buffered cache on output (and sequential block buffering on input) if the assigned
file qualifies. The file must be open in the OUTPUT, I-O, or EXTEND mode.
The size of the buffer space used for writing is 29K characters, regardless of the
number in the RESERVE clause.
This technique buffers records in cache rather than writing them immediately to
disk, thereby reducing the number of requests to the disk process. Audited files
always use buffered cache; nonaudited files can use buffered cache or write-
through cache under DP2. Write-through cache transfers each record to the disk
as it is written.
You can use the File Utility Program (FUP) commands SET and ALTER to set the
BUFFERED attribute for a file, specifying that any programs that open that file
must use buffered cache. If a file has the BUFFERED attribute set, a process can
still override the attribute by calling the Guardian routine SETMODE to specify that
buffered cache must not be used, but the run-time routines do not do this. If a
COBOL program specifies RESERVE 1 AREA for a file that already has the
BUFFERED attribute set, the disk process still uses buffered cache.
Note. With the advent of the DP2 disk processing system, normal I/O could be faster than
sequential block buffering, depending on the number of records per block. For example, a
file containing eight 4K blocks and 1600 records requires one physical I/O operation and
1600 interprocess messages in normal mode, but eight physical I/O operations and only
eight interprocess messages in SBB mode; on the other hand, a file with eight 4K blocks
and only eight records requires one physical I/O and eight interprocess messages in
normal mode, but eight physical I/O operations and eight interprocess messages in SBB
mode