For any type of file, including sequential, VSAM,
REGIONAL(1) and HFS, you can define the external name by using the
following methods:
- In the MVS or TSO environment:
- A ddname in the JCL
- An environment variable name
- The TITLE option of the OPEN statement
- In the USS environment:
- An environment variable name
- The TITLE option of the OPEN statement
The following rules of precedence apply in determining
when the dynamic allocation takes place:
- If one of the following DD statement exists for the file, it is
used. This rule is not valid in the USS environment.
- JCL DD
- TSO ALLOCATE
- User-initiated dynamic allocation
- If a DD statement does not exist for the file and the TITLE option
is specified in the OPEN statement, the TITLE option is used by associating
it with the external name for the file.
- If a DD statement does not exist for the file and the TITLE option
is not specified, but an environment variable exists for the file,
the environment variable is used by associating it with the external
name for the file.
The file is dynamically allocated by using the attributes specified
by the environment variable or TITLE option. At a minimum, the PATH()
or DSN() option must be specified, with the DSN() option accompanied
by a disposition value. All options and attributes must be in uppercase,
except for the pathname suboption of the PATH option, which is case
sensitive. Temporary data set names in the DSN() option are not allowed.
For MVS data sets, the Enterprise PL/I run time checks the contents of the environment
variable or TITLE option at each OPEN statement:
- If a file with the same external name was dynamically allocated
by a previous OPEN statement, and the contents of the environment
variable or TITLE option have changed since that OPEN statement, the
run time dynamically deallocates the previous allocation and reallocates
the file by using the options that is currently set in the environment variable
or specified in the TITLE option.
- If the contents of the environment variable or TITLE option have
not changed, the run time uses the current allocation without taking
the action of deallocation or reallocation.
For HFS files, the DD statement is deallocated and
reallocated at each subsequent OPEN statement.
To use PL/I dynamic allocation, you must specify the file names
by using the DSN() format for MVS data sets, or using the PATH() format for HFS files
as shown in the following examples:
OPEN FILE(FILEIN) TITLE('DSN(USER.FILE.EXT),SHR');
OPEN FILE(FILEIN) TITLE('PATH(/usr/FILE.EXT)');
EXPORT DD_FILE="DSN(USER.FILE.EXT),SHR"
EXPORT DD_FILE="PATH(/usr/FILE.EXT)"
Notes:
- When you use the DSN() or the PATH() format specification for PL/I dynamic
allocation, if a DD statement and the TITLE option of the OPEN
statement are both specified for a file, the DD statement is used
and the TITLE option is ignored.
- Under the USS environment, user-initiated dynamic allocation is
not supported. If it is attempted, the UNDEFINEDFILE condition is
raised, even if the TITLE or environment variable option is used,
because the external name is in use.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)