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

Choosing a data set type

When planning your application, you must first decide which type of data set to use. There are three types of workstation VSAM data sets and five types of non-VSAM data sets available to you. Workstation VSAM data sets can provide all the functions of the other types of data sets, plus additional functions available only with workstation VSAM. Workstation VSAM can usually match, or even improve upon, the performance of other data set types. However, workstation VSAM is more subject to performance degradation through misuse of functions.

Table 15 shows you the possibilities available with each type of workstation VSAM data set. When choosing between the workstation VSAM data set types, you should base your decision on the most common sequence in which your program accesses your data. You can use the following procedure to ensure a combination of data sets and indexes that provide the function you require:

  1. Determine the type of data and how it is accessed.
    1. Primarily sequentially -- favors ESDS.
    2. Primarily by key -- favors KSDS.
    3. Primarily by number -- favors RRDS.
  2. Determine how you load the data set. Note that you must load a KSDS in key sequence; thus an ESDS with an alternate index path can be a more practical alternative for some applications. Table 16 shows types of processing that you can use on alternate index paths
  3. Determine whether you require access through an alternate index path. These are only supported on KSDS and ESDS. If you require an alternate index path, determine whether the alternate index has unique or nonunique keys. The use of nonunique keys can limit key processing. However, it might also be impractical to assume that you use unique keys for all future records; if you attempt to insert a record with a nonunique key in an index that you have created for unique keys, it will cause an error.
  4. When you have determined the data sets and paths that you require, ensure that the operations you have in mind are supported. Figure 18 shows the workstation VSAM data sets and the file attributes that you can specify.

Do not try to access a dummy workstation VSAM data set, because you will receive an error message indicating that you have an undefined file.

Table 17, Table 18, and Table 19 show the statements allowed for sequential data sets, keyed data sets, and direct data sets, respectively.

Figure 18. VSAM data sets and allowed file attributes
         SEQUENTIAL        KEYED SEQUENTIAL    DIRECT

INPUT    ESDS              ESDS                KSDS
         KSDS              KSDS                RRDS
         RRDS              RRDS                Path(U)
         Path(N)           Path(N)
         Path(U)           Path(U)

OUTPUT   ESDS              ESDS                KSDS
         RRDS              KSDS                RRDS
                           RRDS                Path(U)

UPDATE   ESDS              ESDS                KSDS
         KSDS              KSDS                RRDS
         RRDS              RRDS                Path(U)
         Path(N)           Path(N)
         Path(U)           Path(U)


Key:  ESDS     Entry-sequenced data set
      KSDS     Key-sequenced data set
      RRDS     Relative record data set
      Path(N)  Alternate index path with nonunique keys
      Path(U)  Alternate index path with unique keys

You can combine the attributes on the left with those at
the top of the figure for the data sets and paths shown.
For example, only an ESDS and an RRDS can be SEQUENTIAL OUTPUT.

PL/I does not support dummy VSAM data sets.
Table 16. Processing allowed on alternate index paths
Base Cluster Type Alternate Index Key Type Processing Restrictions
KSDS Unique key

Nonunique key

As normal KSDS

Limited keyed access

May not modify key of access.

May not modify key of access.

ESDS Unique key

Nonunique key

As KSDS

Limited keyed access

No deletion.

May not modify key of access.

No deletion.

May not modify key of access.

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