Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Associating several data sets with one file

A PL/I file can, at different times, represent entirely different data sets. The TITLE option allows you to choose dynamically, at open time, among several data sets to be associated with a particular PL/I file. Consider the following example:

  do Ident='A','B','C';
    open file(Master) title('/MASTER1'||Ident||'.DAT');
         .
         .
         .
    close file(Master);
  end;

In this example, when Master is opened during the first iteration of the do-group, the file is associated with the data set named MASTER1A.DAT. After processing, the file is closed, dissociating the PL/I file MASTER from the MASTER1A.DAT data set. During the second iteration of the do-group, MASTER is opened again. This time, MASTER is associated with the data set named MASTER1B.DAT. Similarly, during the final iteration of the do-group, MASTER is associated with the data set MASTER1C.DAT.


Terms of use | Feedback

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