You can use the TITLE option of the OPEN statement to identify the data set to be associated with a PL/I file, and, optionally, to provide additional characteristics of that data set.
>>-TITLE--(expression)-----------------------------------------><
The expression must yield a character string with the following syntax:
>>-+-alternate_ddname---------------+-------------------------->< | .------------------. | | V | | '-/filespec---+--------------+-+-' '-,--dd_option-'
open file(Inventry) title('PARTS');
For more about options of the DD_DDNAME environment variable, see Specifying characteristics using DD_DDNAME environment variables.
Here is an example of using the OPEN statement in this manner with a z/OS DSN:
open file(Payroll) title('/June.Dat,append(n),recsize(52)');Note the required leading forward slash in the TITLE option. This leading forward slash indicates that what follows is a file name (rather than a DD name). In this case, June.Dat refers to an MVS dataset.
If June.Dat is an HFS file, the example would look like this:
open file(Payroll) title('//u/USER/June.Dat,append(n),recsize(52)');Note the two forward slashes in the TITLE option: the first indicates that what follows is a file name (rather than a DD name), and the second is the start of the fully-qualified HFS file name.
Relative HFS file names can also be specified in place of fully-qualified names. In the following example:
open file(Payroll) title('./June.Dat,append(n),recsize(52)');The dataset name June.Dat will be prefixed with the pathname of the current z/OS UNIX directory.
With this form, PL/I obtains all DD information either from the TITLE expression or from the ENVIRONMENT attribute of a file declaration - a DD_DDNAME environment variable is not referenced.