COBOL Manual for TNS and TNS/R Programs

HP COBOL Manual for TNS and TNS/R Programs522555-006
26-1
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.
Topics:
Files
Processes Handled as Files
Intercepting Operating System Messages
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.
Topics:
System File Names
COBOL File Names
Associating COBOL File Names With System File Names
Prereading File Records
For information about creating files, see the Guardian Programmer’s Guide.