COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
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.
You must not use buffered cache in applications that require each record to be actually written
to disk before execution of the next statement in the program.
• HP COBOL Fast I-O (Local Buffering)
HP COBOL Fast I-O is an enhancement in input-output performance beyond that of sequential
block buffering or buffered cache. It is available if a program and the sequential file on which
it is to operate meet these criteria:
◦ You are not creating an audited file (you can read an audited file, however).
◦ The file description includes a RESERVE clause with a number specifying the number of
blocks to buffer. The number must be greater than 2.
◦ The file description does not include a LINAGE clause or a CODE-SET clause.
◦ The file is not opened with time limits (as with the TIME LIMITS phrase in the OPEN
statement).
◦ The file’s open mode is either INPUT or OUTPUT. If it is INPUT, its exclusion mode is
PROTECTED; if it is OUTPUT, its exclusion mode is EXCLUSIVE.
◦ The program is not compiled with the NONSTOP directive.
◦ Regarding fast I-O and alternate keys, you must adhere to these rules:
If the program is compiled with ENV OLD, there must be no alternate keys either in
the SELECT statement or in the file itself.
–
– If the program is compiled with ENV COMMON, there must be no alternate keys
mentioned in the SELECT statement. Any alternate keys that exist in the file must be
set to NO UPDATE with FUP.
With HP COBOL Fast I-O, the run-time routines use an auxiliary block buffer and perform the
blocking and deblocking in local storage. This can operate as much as ten times faster than
having the operating system perform the blocking and deblocking operations.
The size of the buffer space used for reading is 2 * number *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.
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 writing is 29K characters, regardless of the number in
the RESERVE clause.
If the RESERVE clause specifies a number that uses HP COBOL Fast I-O and the assigned
file qualifies for HP COBOL Fast I-O, but there is not enough buffer space for HP COBOL Fast
I-O, then the I-O status code is “07” and sequential block buffering is used.
124 Environment Division










