Wednesday 19 August 2015

VSAM file types

KSDS (Key Sequential DataSet)
  • The data records are identified based on the key value.
  • The data in the KSDS is divided into two components viz., Index component and data component. Index component contains the unique key value and its corresponding memory location.Data component contains the memory address and actual data.
  • Index component contains pointers to all the data records and Data component contains actual data records which were arranged in logical order based on key fields. 
  • If we want to search for a particular record, we will give the unique key value. Then the corresponding address location for that key will be retrieved. This location will be used to get the data record.
Notes from IBM manual on KSDS:

To find the physical location of a record in a KSDS, VSAM creates and maintains an index. This relates the key of each record to the record's relative location in the data set. When you add or delete records, this index is updated accordingly.

ESDS (Entry Sequential DataSet)
  • The data records are stored in the order they are entered into the dataset. New records will be added after the last record.
  • The data records are identified by relative byte address (RBA). For eg., If the file has 100 byte records, the RBA for the first record is 0, the RBA for the second record is 100, the RBA for the third record is 200 and so on.
  • The records can be accessed either sequentially or directly by providing RBA value of the corresponding record.
  • The records in ESDS are either fixed length or variable length. 
  • It contains only data component, no index component.
RRDS (Relative Record DataSet)
  • The records are identified by RRN (Relative Record Number ).
  • RRN is a sequence number relative to the first record.
  • All the records must be of fixed length. The records can be accessed sequentially in the order by RRNs, or directly by providing the RRN.
  • The records are filled in each block until we cannot fit the another record. The space in each block will be left unused.
LDS (Linear DataSet)
  • This is a byte-stream data set and is the only form of byte stream data set in traditional OS files.
  • A linear data set (LDS) contains data that can be accessed as byte-addressable strings in virtual storage.
  • It will have only data component like ESDS and RRDS. This does not have RDFs and CIDFs but have a control interval with size of 4K bytes.

No comments:

Post a Comment