Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Programming Guide

Choosing a data set type

When planning your program, the first decision to be made is which type of data set to use. There are three types of VSAM data sets and five types of non-VSAM data sets available to you. VSAM data sets can provide all the function of the other types of data sets, plus additional function available only in VSAM. VSAM can usually match other data set types in performance, and often improve upon it. However, VSAM is more subject to performance degradation through misuse of function.

The comparison of all eight types of data sets given in Table 14 is helpful; however, many factors in the choice of data set type for a large installation are beyond the scope of this book.

When choosing between the VSAM data set types, you should base your choice on the most common sequence in which you will require your data. The following is a suggested procedure that you can use to help ensure a combination of data sets and indexes that provide the function you require.

  1. Determine the type of data and how it will be accessed.
    1. Primarily sequentially — favors ESDS.
    2. Primarily by key — favors KSDS.
    3. Primarily by number — favors RRDS.
  2. Determine how you will 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.
  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 will have unique or nonunique keys. Use of nonunique keys can limit key processing. However, it might also be impractical to assume that you will 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 34 might be helpful.

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

Table 27, Table 28, and Table 29 show the statements allowed for entry-sequenced data sets, indexed data sets, and relative record data sets, respectively.

Figure 34. 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 26. 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.


Terms of use | Feedback

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