COBOL Manual for TNS and TNS/R Programs
Data Fundamentals
HP COBOL Manual for TNS and TNS/R Programs—522555-006
4-7
Files
Organization
Organization, which specifies a file’s logical structure, is a fixed attribute that is
established when you create the file and cannot be changed.
Table 4-2. File Organization (page1of2)
Organization Description
Sequential A sequential file is organized so that each record except the first has a
unique predecessor record and each record except the last has a
unique successor record. These relationships are established by the
order in which the records are written and cannot be subsequently
changed. The only alterations a program can make to an existing
sequential file are record replacement (updating an existing record) and
record creation (appending a new record following the last existing
record).
Under the NonStop operating system, COBOL sequential files are
unstructured files or entry-sequenced files.
Line Sequential A line sequential file (code 180) is a sequential file that is compatible
with the system text editor of the OSS environment; therefore, it can
also be called an OSS ASCII text file. A line sequential file differs from a
sequential file in that each of its records ends with a line-feed character.
For its other characteristics, see Line Sequential Files
.
Under the NonStop operating system, COBOL line sequential files are
line sequential files.
Relative A relative file is organized as a sequence of record areas, each capable
of holding a logical record. The successive record areas are uniquely
identified by successive integer values (called relative record numbers),
beginning with one for the first record area. A program can select any
record area for an operation by providing the value of its relative record
number. Because a program can fill or empty individual record areas
independently, without regard to the presence or absence of logical
records in any of the other areas, any combination of record areas can
be full or empty at any given time in the file’s existence.
Under the NonStop operating system, COBOL relative files are relative
files.
Indexed An indexed file is organized as a set of records uniquely identified by the
values of their prime record key, a data item defined within each logical
record of the file. A program can select any record for an operation by
providing the value of its prime record key.
Under the NonStop operating system, COBOL indexed files are key-
sequenced files.