Sunday 21 April 2019

When to use which VSAM data set (i.e. EDS, KSDS, RRDS, LDS, ESDS) ?

VSAM dataset
Not sure when to use which data set. 

Being a programmer I have faced situations where you are not sure which VSAM data set is suitable for business applications.

In fact, as per my experience, there is the various factor that a programmer/designer should consider before finalizing data set which should be used for storing data.    

In this tutorial, I have tried to compile key points that might help you in taking a decision.

Use KSDS if:
  1. The data access is sequential, skip sequential, or direct access by a key field
  2.  You would prefer easy programming for direct data processing
  3.  There will be many record insertions, deletions, and logical record length varies
  4.  You may optionally access records by an alternate index
  5.  Complex recovery (due to index and data components) is not a problem
  6.  You want to use data compression.

Use RRDS if:
  1. The record processing is sequential, skip sequential, or direct processing.
  2. Easy programming for direct processing is not a requirement.
  3. The argument for accessing data in direct mode is a relative record number, not the contents of a data field (key). RRDS is suitable for the type of logical records identified by a continuous and dense pattern of numbers (such as 1,2,3,4...).
  4. All records are fixed length.
  5. There are a small number of record insertions and deletions, and all the space for insertions must be pre-allocated in advance.
  6. Performance is an issue. RRDS performance is better than KSDS but worse than QSAM or BSAM.
Use ESDS if:
  1. You are adding logical records only at the end of the data set and reading them sequentially (in the application control)
  2.  The logical record is variable length
  3.  You seldom need direct record processing by key (using AIX)
  4.  You are using a batch processing application.

Use LDS if:
  1.  You want to exploit DIV
  2.  Your application manages logical records
  3.  Performance is an issue.

No comments:

Post a Comment

New In-feed ads