COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

NOTE: To see what ASSIGN commands are currently in force, enter just ASSIGN followed by
a carriage return.
Usage Considerations:
Places for ASSIGN Commands
You can give ASSIGN commands individually at the TACL prompt before you enter the RUN
command, or you can place the ASSIGN commands in an EDIT-format file and use the OBEY
command to execute all the commands in the file. You could also include the RUN command
in the OBEY command file.
Special COBOL Names for Operating System Files
See Operating system file names and Special names for operating system files.
Example 158 #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.
...
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 (page 375)).
The temporary file in Example 159 is purged when it is closed.
Example 159 ASSIGN Command With Special COBOL Names
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.
ASSIGN Command 585