COBOL Manual for TNS and TNS/R Programs

Using HP COBOL in the OSS Environment
HP COBOL Manual for TNS and TNS/R Programs522555-006
19-11
OSS Files in HP COBOL Source Programs
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” orGUARDIAN,” 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.
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.)
Note. The operating system does not check for this.