z/OS DFSMS Using Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Selection of VSAM Data Set Types

z/OS DFSMS Using Data Sets
SC23-6855-00

VSAM supports several data set types: entry-sequenced (ESDS), key-sequenced (KSDS), linear (LDS), fixed-length, and variable-length relative record (RRDS). Before you select a data set type, consider the following questions:
  • Will you need to access the records in sequence, randomly, or both ways?
  • Are all the records the same length?
  • Will the record length change?
  • How often will you need to move records?
  • How often will you need to delete records?
  • Do you want spanned records?
  • Do you want to keep the data in order by the contents of the record?
  • Do you want to access the data by an alternate index?
  • Do you want to use access method services utilities with an IBM DB2 cluster?
Entry-sequenced data sets are best for the following kinds of applications:
  • Applications that require sequential access only. It is better to use entry-sequenced data sets or variable-length RRDSs for sequential access, because they support variable-length records and can be expanded as records are added.
  • Online applications that need to use an existing entry-sequenced data set. If you want to use an entry-sequenced data set in an online application, load the data set sequentially by a batch program and access the data set directly by the relative byte address (RBA).
Key-sequenced data sets are best for the following kinds of applications:
  • Applications that require that each record have a key field.
  • Applications that require both direct and sequential access.
  • Applications that use high-level languages which do not support RBA use.
  • Online applications usually use key-sequenced data sets.
  • You want to access the data by an alternate index.
  • The advantage of key-sequenced data sets over fixed-length RRDS using direct access is ease of programming.
  • You want to have compressed data.
Linear data sets, although rarely used, are best for the following kinds of applications:
  • Specialized applications that store data in linear data sets
  • Data-in-virtual (DIV)
Relative-record data sets are best for the following kinds of applications:
  • Applications that require direct access only.
  • Applications in which there is a one-to-one correspondence between records and relative record numbers. For example, you could assign numeric keys to records sequentially, starting with the value 1. Then, you could access a RRDS both sequentially and directly by key.
  • Fixed-length RRDSs use less storage and are usually faster at retrieving records than key-sequenced data sets or variable-length RRDSs.
  • If the records vary in length, use a variable-length RRDS.
  • Variable-length RRDSs can be used for COBOL applications.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014