Rational Developer for System z
Enterprise PL/I for z/OS, Version 4.2, Programming Guide

Allocating files

For any type of file, including sequential, VSAM, REGIONAL(1) and HFS, you can define the external name by using the following methods:

The following rules of precedence apply in determining when the dynamic allocation takes place:

  1. If one of the following DD statement exists for the file, it is used. This rule is not valid in the USS environment.
  2. 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.
  3. 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:

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:
  1. 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.
  2. 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.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)