You can use the TITLE option to associate two or more PL/I files with the same external data set, provided the first file association is closed before opening a second file association against the same TITLE name. The following example, where INVNTRY is the name of a DD statement defining a data set to be associated with two files:
OPEN FILE (FILE1) TITLE('INVNTRY');
.....
CLOSE FILE (FILE1);
.....
OPEN FILE (FILE2) TITLE('INVNTRY');If the file is not closed first before the second open is done, the UNDEFINEDFILE condition will be raised with a subcode1 value of 59, stating that an open was attempted against a file that was already open.