COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-29
FILE-CONTROL Paragraph
OPTIONAL
makes the file optional, which means that an OPEN statement with an INPUT,
I-O, or EXTEND phrase can open the file whether or not the file exists. If the
file exists, its I-O status code is “00”; if not, its I-O status code is “05”.
OPTIONAL does not affect the OPEN statement with an OUTPUT phrase.
When you open a nonexistent optional file for input, the first READ statement
for that file uses the AT END option (or USE procedure if the READ statement
has no AT END phrase).
file-name
is the COBOL file-name (the file-name in a file description entry).
ASSIGN clause
associates file-name with system-file-name or define-name-literal.
Only the first system-file-name or define-name-literal has meaning.
The compiler ignores subsequent names and literals and issues a warning.
system-file-name
is the name of a file that the file system recognizes or one of the special
operating system file names described in System-Names. If system-file-
name does not begin with a dollar sign ($), backward slash (\), or number sign
(#), then it must be enclosed in quotation marks unless it forms a COBOL
word. For more information about operating system file names, see the
Guardian Procedure Calls Reference Manual.
define-name-literal
is allowed only in the Guardian environment. It is a nonnumeric literal
representing a DEFINE name of class MAP, SPOOL, TAPE, or
TAPECATALOG. Quotation marks must enclose define-name-literal. For
more information about DEFINE names, see DEFINEs.
ASSIGN
TO
define-name-literal
system-file-name
VST039.vsd