COBOL Manual for TNS and TNS/R Programs

Input and Output Concepts
HP COBOL Manual for TNS and TNS/R Programs522555-006
26-5
Associating COBOL File Names With System File
Names
Associating COBOL File Names With System File Names
The file-control entry for a file associates its COBOL file name with one of:
System File Name
Special Name
DEFINE Name
If you want to associate the COBOL file name with a system file name at run time, see
#DYNAMIC.
System File Name
The most straightforward way to associate a COBOL file name with a system file name
is to use the file-control entry to assign a COBOL file name (the file-name in the
SELECT clause) to a system file name (the system-file-name in the ASSIGN
clause).
These SELECT and ASSIGN clauses associate the COBOL file name MAJRACCT
with the system file name \AKRON.$SLB.MAJ.ACC:
SELECT MAJRACCT ASSIGN TO "\AKRON.$SLB.MAJ.ACC"
When the HP COBOL program opens MAJRACCT, the file it actually opens is
\AKRON.$SLB.MAJ.ACC.
In the Guardian environment, you can override the file assignment that you made at
compilation time before executing the program (see Overriding File Assignments Made
at Compilation Time). You cannot do this in the OSS environment.
For the syntax of a system file name in the Guardian environment, see the Guardian
Programmers Guide. For the syntax of a system file name in the OSS environment,
see Files in the OSS Environment.
Special Name
A special name is a place holder for a specific file whose system file name is
determined at run time.
Table 26-1. Special Names for System Files (page 1 of 2)
Special System File Name Place holder for ...
#IN
In the Guardian file system, the file named in the IN
parameter of startup message of current process
In the OSS file system, the default input device (FD 0)—
do not use it in SELECT clauses or the SPECIAL-NAMES
paragraph as you can in the Guardian environment