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

Allocating Files

For any type of file, including sequential, VSAM, REGIONAL(1) or HFS in your z/OS applications, you can define the external name by using a ddname in the JCL, an environment variable name, or the TITLE option of the OPEN statement.

If the file is accessed in the USS environment, you can define the external name by either using an environment variable name, or the TITLE option of the OPEN statement.

Because the external name can be defined in three ways, the following rules of precedence apply in determining when the dynamic allocation takes place:

  1. If the TITLE option is specified in the OPEN statement, the TITLE option will be used.
  2. If the TITLE option is not specified and there is a DD statement such as JCL DD, TSO ALLOCATE, or user-initiated dynamic allocation for the file, the DD statement will be used.
  3. If the TITLE option is not specified and there is no DD statement for the file, but there is an environment variable for the file, the environment variable will be used.

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 path name suboption of the PATH option, which is case sensitive. Temporary data set names in the DSN() option are not allowed.

The Enterprise PL/I run-time checks the contents of the environment variable or TITLE option at each OPEN statement:

To allocate the file dynamically, you must specify the file name using the DSN(xxx) format for MVS files, or the PATH(xxx) format for HFS files as shown in the following example:

                 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)"

Terms of use | Feedback

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