COBOL Manual for TNS and TNS/R Programs
Program Execution
HP COBOL Manual for TNS and TNS/R Programs—522555-006
12-8
ASSIGN Command
•
Special COBOL Names for Operating System Files
See Operating system file names and Special names for operating system files.
•
Interaction Between ASSIGN Command and OPEN Statement
The interaction between the exclusion-specification of the ASSIGN
command and the exclusion-mode of the OPEN statement is:
°
If an exclusion-mode is given in the OPEN statement, that value is used
regardless of any ASSIGN command settings.
°
If the OPEN statement has no exclusion-mode but the ASSIGN command
for the file does give an exclusion-specification, the ASSIGN
command value is used.
°
If neither the exclusion-mode of the OPEN statement nor the exclusion-
specification of the ASSIGN command is present, the COBOL default
mode is active (see OPEN).
The temporary file in Example 12-3 is purged when it is closed.
Example 12-2. #TEMP
17>ASSIGN temp-file,#TEMP
18>RUN program
...
* File created on run-time default volume
OPEN I-O temp-file
...
* File purged
CLOSE temp-file
...
* New empty file created
OPEN I-O temp-file
...
* File automatically closed and purged
STOP RUN.
...
Example 12-3. ASSIGN Command With Special COBOL Names (page 1 of 2)
11>ASSIGN REPORT-OUT, $TERM4
12>RUN MYPROG
13>ASSIGN IN-MASTER,$DATA.ZZ.INFILE
14>RUN MYPROG1
15> == FD INPUT-FILE is the
16>ASSIGN INPUT-FILE, #IN == file named in the
17> == IN option.
18> == FD WORK-FILE is to be
19>ASSIGN WORK-FILE, #TEMP == a temporary disk file
20> == on the default volume.