COBOL Manual for TNS and TNS/R Programs
Environment Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
6-41
FILE-CONTROL Paragraph
SELECT clause
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 either the name of a disk file or the special file name #DYNAMIC or #TEMP.
Quotation marks must enclose system-file-name unless it is a COBOL
word or begins with a dollar sign ($), a backward slash (\), or a number sign
(#). For more information about operating system file names, see the Guardian
Procedure Calls Reference Manual.
define-name-literal
is a nonnumeric literal. It represents the name of a DEFINE of class MAP that
is associated with a disk file. Quotation marks must enclose define-name-
literal. For information on DEFINE names, see DEFINEs.
SELECT
file-name
OPTIONAL
VST038.vsd
ASSIGN
TO
define-name-literal
system-file-name
VST039.vsd