COBOL Manual for TNS/E Programs (H06.03+)
Disk Input and Output
HP COBOL Manual for TNS/E Programs—520347-003
28-10
Structured Files
When using an unstructured file, an HP COBOL program still operates on the basis of
records, but they are strictly logical records. If one HP COBOL program writes an
unstructured file of 80-character records, another program can read it with any record
length. If the reading program expects 37-character records, the run-time routines
deliver 37-byte pieces of the continuous byte stream. You can rewrite a record with
another record of the same length, but you cannot delete a record.
The HP COBOL run-time routines that access unstructured disk files manage those
files directly. An unstructured file has no records, as far as Enscribe is concerned; the
declarations in your HP COBOL program determine how the HP COBOL run-time
routines manipulate the unstructured files.
Structured Files
Structured disk files are either entry-sequenced, relative, or key-sequenced.
The HP COBOL run-time routines that access structured disk files (entry-sequenced,
relative, and key-sequenced) do so with the help of the operating system routines that
are collectively called the Enscribe database record manager.
Table 28-3. Corresponding HP and HP COBOL Disk File Terms
HP Term HP COBOL Term
Relative Relative
Entry-sequenced Sequential
Key-sequenced Indexed
Table 28-4. Comparison of Structured File Characteristics (page 1 of 2)
Characteristic
Type of Structured File
Entry-Sequenced
(Sequential) Relative
Key-Sequenced
(Indexed)
Records
ordered by ...
Order in which they
were entered
Record number Value of prime record
key
Access is by ... Record address or
alternate record key
Maximum alternate
record key length =
253 bytes (249 if not
unique)
Record number or
alternate record key
Maximum record
number = 1,048,575
Maximum alternate-
key length = 253 bytes
(249 if not unique).
Prime or alternate
record key
Maximum prime record
key length = 522 bytes
Maximum alternate
record key length = 253
bytes (253 minus prime
length if not unique)










