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-' | | .---------------. | | V | | +-DSN--(--dsname--)----,--dsn_option-+-+ '-PATH--(--pathname--)-----------------'
open file(Inventry) title('PARTS');
For more information about the options of the DD_DDNAME environment variable, see Specifying characteristics using DD_DDNAME environment variables.
For more information about the DSN options, see Defining QSAM files using PL/I dynamic allocation, Defining REGIONAL(1) data sets using PL/I dynamic allocation, and Defining VSAM file using PL/I dynamic allocation.
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 looks 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, for 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.
The following examples show how to use the OPEN statement with PL/I dynamic allocation support:
OPEN FILE(QSAM01) title('DSN(USER.FILE.EXT),SHR'); OPEN FILE(QSAM01) title('PATH(/u/USER/sample.txt)');