Assignment name for data-names and environment variables
If an environment variable or data-name is specified for the assignment name, the value of the data-name or the environment variable is processed as described below.
The value in data-name-9 or
the environment variable is evaluated each time that an OPEN statement
for the corresponding COBOL file is executed. If the value does not
contain any hyphens, the entire string is treated as file name
information. File name information can be a single system
file-name, or a single system file-name followed by a list of alternate
index file-names, or a concatenation of system file-names that are
separated by colons. For each of these alternatives, each system
file-name can be qualified by a path name. If the value contains one
or more hyphens with at least one character after the leftmost hyphen,
and the string to the left of the leftmost hyphen meets all the following
criteria, the value is interpreted as file-system-ID,
followed by file name information:
- The string consists of three or more characters.
- The first (leftmost) three characters are alphanumeric (A-Z, a-z, or 0-9).
- The first character is alphabetic (A-Z or a-z).
- file-system-ID
- The first three characters of file-system-ID, folded to uppercase, are interpreted as the file-system ID, subject to validation at run time. The value of a file-system ID that is specified at run time overrides any file-system ID that is specified in the user-defined word of assignment-name-1.
- file name information
- One of the three forms of file name information. For information about specifying alternate indexes, see "Specifying alternate indexes" under Assignment name for user-defined words and literals.
The examples in the following table assume that runtime option FILESYS has been set to STL, and thus the file-system ID defaults to STL.
Environment variable value or data-name value | File-system ID | System file-name |
---|---|---|
my-fyle |
STL |
my-fyle |
abc/my-fyle |
ABC (invalid) |
fyle |
payroll-fyle |
PAY (invalid) |
fyle |
rsd-payroll-file |
RSD |
payroll-file |
\\Strange (...) name! |
STL |
\Strange (...) name! |
Db2-File1 |
Db2 |
File1 |
./Db2-File2 |
STL |
./Db2-File2 |
sfs-/.:/cics/sfs/svr/F1 |
SFS |
F1 (on
SFS server svr ) |
STL-/.:/cics/sfs/svr/F1 |
SFS |
(Invalid path) |
stl-file1:file2 |
STL |
file1 and file2 (concatenated) |
For more information about identifying files, see Identifying files in the COBOL for Linux® on x86 Programming Guide.
For more information about file concept and terminology, see File concepts and terminology in the COBOL for Linux on x86 Programming Guide.