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

Adapting programs using VSAM files

If you use the VSAM ENVIRONMENT option, the associated workstation VSAM data set must exist before the file is opened. You can create your data sets with a simple program. Figure 18 is an example of creating a workstation VSAM keyed data set.

Figure 18. Creating a workstation VSAM keyed data set
 /********************************************************************/
 /*                                                                  */
 /*  NAME - ISAM0.PLI                                                */
 /*                                                                  */
 /*  DESCRIPTION                                                     */
 /*    Create an ISAM Keyed data set                                 */
 /*                                                                  */
 /*                                                                  */
 /********************************************************************/

 NewVSAM: proc options(main);
      declare
          NewFile keyed record output file
                  env(organization(indexed)
                      recsize(80)
                      keylength(8)
                      keyloc(17)
                     );
          open file(NewFile) title('/KEYNAMES.DAT');
          close file(NewFile);
 End NewVSAM;

If the data set named KEYNAMES.DAT does not already exist, PL/I creates it with that name when the OPEN statement is executed.


Terms of use | Feedback

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