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.
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.
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.| 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. |