COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
26 Input and Output Concepts
Input and output are involved in virtually every HP COBOL program. The typical batch HP COBOL
program obtains data (input), manipulates it, and produces a report (output). The typical interactive
HP COBOL program is a server that obtains a request, collects data (input), and sends a reply
(output).
Input and output always involve files. Input for an HP COBOL program comes from a disk file or
nondisk file (such as a terminal); output from an HP COBOL program goes to a disk file or nondisk
file (such as a terminal or printer).
Process communication involves files—one process calls another by handling it as a file—and
operating system messages. An HP COBOL process ignores operating environment messages
unless you arrange to have it intercept them.
Files
Files of alphanumeric data are ASCII files; that is, they are encoded in American National Standard
Code for Information Interchange (ASCII).
Files are controlled by a file system, a combination of input-output hardware and operating system
routines that mediate between the hardware and application programs. The NonStop operating
system supports two file systems: the Guardian file system and the OSS file system.
Both file systems recognize a file by its system file name; an HP COBOL program recognizes a
file by its COBOL file name, a name that the program defines. For an HP COBOL program to
access or manipulate an actual file, the file’s COBOL file name must be associated with a system
file name.
Under certain conditions, the HP COBOL run-time routines preread file records (starting the read
for record n +1 when returning record n to the program), saving execution time by overlapping
reading and processing.
For information about creating files, see the Guardian Programmer’s Guide.
System File Names
A system file name is the name by which the Guardian or OSS file system recognizes a system
file. That name is unique, not only on the system where the file is physically located, but also within
that system’s network.
These rules and the remainder of this topic apply to all system file names in the Guardian file
system. For information about system file names in the OSS file system, see Files in the OSS
Environment (page 713).
• System file names are composed of alphanumeric characters and these special characters,
which are used as delimiters:
◦ Backward slash (\)
◦ Dollar sign ($)
◦ Number sign (#)
◦ Colon (:)
◦ Period (.)
• System file names are not case-sensitive; \NODE1.$VOLUME1.SUBVOL1.FILE1 and
\node1.$volume1.subvol1.file1 refer to the same file.
830 Input and Output Concepts










