Selecting VSAM Dataset types and Guidelines (for Beginners)


For basic information, go through the Selecting VSAM Dataset types and Guidelines (for Experienced)

Selection of VSAM Dataset types?

The application programmer has to use a VSAM dataset in his day-to-day activities during the application development process. At that time, the application developer has to select a suitable dataset type based on his requirement. However, VSAM has several types and different ways of accessing data. So developer should use some factors to choose a suitable dataset.

Before going to select the specific VSAM dataset, raise the below questions to get more clarity on what dataset to select -

  • What is the main purpose of the dataset? Simple dataset, log file, a database, or an inventory?
  • What is the mode using to access the data by using the key? (Sequential or direct)
  • How do we access the records? (In sequence, skip sequential, randomly, or all of them)
  • What type of logical records? (Fixed-length or Variable-length)
  • Does the processing have insertions or deletions?
  • Possibility of deleting records? If yes, How often?
  • Requirement of IDCAMS utility functions?
  • What is the order to keep the records in the dataset? (Based on the key field or based on the insertion or RBA or RRN)

Use the above answers to select the best VSAM dataset that fits the requirement.

Note! VSAM access method cannot process non-VSAM datasets, and non-VSAM application cannot process VSAM datasets.

Guidelines to select dataset -

Following are some guidelines for choosing a dataset organization. The organizations are presented in the order from lowest to highest in processor and I/O consumption.

Choose PS file when -

  • No direct processing.
  • No insertions and deletions.
  • We are adding records only at the end of the dataset.
  • No logical record length change.
  • Performance and recovery are the main concerns.

Choose ESDS when -

  • A requirement of reading records sequentially.
  • There is no issue with adding logical records only at the end of the dataset.
  • The logical record is variable-length.
  • Using a batch processing application.

Choose KSDS when -

  • Data access is sequential, skip sequential, or direct access by a key field.
  • Prefer easy programming for direct data processing.
  • Having many record insertions, deletions, and logical record length variations.
  • Recovery is not a problem.
  • Accessing records by an alternate index optionally.

Choose fixed-length RRDS when -

  • Record processing is sequential, skip sequential, or direct processing.
  • The accessing data argument is an RRN in direct mode, not the key.
  • All records are fixed length.
  • Performance is an issue. (RRDS performance is better than KSDS but worse than QSAM or BSAM).

Choose variable-length RRDS when -

  • Having the exact requirements for a KSDS, but use RRN instead of a key field as the argument.

Choose LDS when -

  • Using DIV.
  • Application manging logical records.
  • Performance is an issue.