COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Within an HP COBOL program, the maximum length of an OSS pathname is the maximum length
of a literal (160 characters).
OSS Files in HP COBOL Source Programs
The only OSS files that an HP COBOL program can use are line sequential files (see Line Sequential
Files) and sequential files with fixed-length records and no alternate keys. Relative files, indexed
files, and sequential files with keys or variable-length records must be Guardian files (Enscribe
files), and their OSS pathnames must include “/G” or “GUARDIAN” (see OSS Pathnames for
Guardian Files). If the OSS pathname of a sequential file does not include “/G” or “GUARDIAN,”
then that file is an OSS unstructured file. It has fixed-length records of the maximum record size.
In contrast, the default Guardian sequential file is entry-sequenced and can have variable-length
records.
#IN and #OUT
In the OSS environment, #IN and #OUT are the default input device (FD 0) and the default output
device (FD 1), respectively. You cannot use #IN and #OUT in SELECT clauses or the SPECIAL-NAMES
paragraph as you can in the Guardian environment.
Line Sequential Files
Line sequential files (code 180) are available only in the OSS environment. Their organization is
line sequential. They are compatible with the system text editor of the OSS environment; therefore,
they can also be called OSS ASCII text files. (The X/Open CAE specification defines an OSS ASCII
text file as one that is compatible with the system text editor.)
Line sequential files have these characteristics:
• Every character in a record is printable.
NOTE: The operating system does not check for this.
• Every record ends with a line-feed character, which is appended by a write operation and
removed by a read operation. (This characteristic distinguishes line sequential files from
sequential files.)
• After a read operation, the record area from the last character of the actual record to the end
of the record area is filled with space characters (ASCII character code SP).
• If the record area is shorter than the record in the file, the next read operation starts after the
last character moved to the record area. (The length of the record area is determined by the
RECORD clause if it exists; otherwise it is determined by the largest of the record descriptions.)
These topics explain these items with respect to line sequential files:
• File-Control Entries
• File Description Entries
• I-O-CONTROL Paragraph
• OPEN Statement
• READ Statement
• WRITE Statement
File-Control Entries
The syntax for a file-control entry for a line sequential file is:
716 Using HP COBOL in the OSS Environment










