COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-298
WRITE for Sequential Files
•
Page Overflow
An automatic page overflow condition exists whenever the execution of a write
statement cannot be fully accommodated within the current page body of a printer
file described with a LINAGE clause. This situation arises when the execution of
the WRITE statement would cause the LINAGE-COUNTER to assume a value
greater than the number of lines in the current page body.
In this case, the process prints the record on the logical page before or after
advancing the device to the first line following the top margin of the next logical
page.
If the END-OF-PAGE phrase appears in the WRITE statement, then its imperative
statement is executed after both the print and advancing operations are completed.
When execution of a WRITE statement causes both the end-of-page and the page
overflow conditions to occur, only the actions for the page overflow condition occur.
•
Buffered Cache
Buffered cache, enabled by the RESERVE clause of the FILE-CONTROL
paragraph, speeds the writing of disk files. This technique buffers records up in
cache rather than writing them immediately to disk.
Do 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.
See FILE-CONTROL Paragraph.
•
Variable-Length Records
An Enscribe structured file can have variable-length records. See READ for
Sequential or Dynamic Access.
When you write to a file that is defined as having variable-length records, the
length of the record written depends on whether the file is declared with
RECORD CONTAINS rec-1 TO rec-2 CHARACTERS
or
RECORD IS VARYING IN SIZE FROM rec-1 TO rec-2 CHARACTERS
DEPENDING ON rec-size
form of the RECORD CONTAINS clause.
In the former case, the length of the record specified in the WRITE statement is the
number of characters written to the file system file.
In the latter case, the length of the record written is the value present in the rec-
size data item specified in the DEPENDING clause at the time the WRITE
statement is executed.