Choosing VSAM data set types

When you plan your program, you must first decide the type of data set to use. Figure 1 shows you the possibilities available with the types of VSAM data sets.

Figure 1. Types and advantages of VSAM data sets
graphic

When choosing the VSAM data set type, you should base your choice on the most common sequence in which you require data. You should follow a procedure similar to the one suggested below to help ensure a combination of data sets and indexes that provide the function you require.

  1. Determine the type of data and its primary access.
    • sequentially — favors ESDS
    • by key — favors KSDS
    • by number — favors RRDS
  2. Determine whether you require access through an alternate index path. These are only supported on KSDS and ESDS. If you do, determine whether the alternate index is to have unique or nonunique keys. You should keep in mind that making an assumption that all future records will have unique keys may not be practical, and an attempt to insert a record with a nonunique key in an index that has been created for unique keys causes an error.
  3. When you have determined the data sets and paths that you require, ensure that the operations you have in mind are supported.