Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 2: VSAM Concepts


Data component

  • Data component contains actual data records belonging to that dataset
  • Data records in data component are stored as part of unit called as Control Interval (CI) and Control Intervals are stored as part of unit called as Control Area (CA).

Control Interval (CI)

  • A Control Interval (CI) is a contiguous area of direct access storage used by VSAM to store data records and other control information that describes the records.
  • In non-VSAM data management methods, the unit of data that is transferred between memory(buffer) and storage device(DASD) is defined by block. In VSAM, the unit of data that is transferred between memory (buffer) and storage device (DASD) in each I/O operation is called as Control Interval (CI).
  • Whenever there is need to read a record from VSAM, the entire control interval which contains that particular record is transferred to buffer from DASD.
  • Size of control interval is specified while defining cluster.

Figure: - Illustration of components of Control interval (CI)

A control interval has four components:-

  1. Logical Record Area(LRA)
    • This area contains actual data records
  2. Free Space (FS)
    • As name implies, it is free space that is available and can be used when new records are added to dataset, having said that the records fit in that space
  3. Unused Space (US)
    • When remaining Free Space (FS), may not be of multiple of record length, there will be always unused space within CI.
    • In case of fixed length records, this can be minimized by specifying proper Control Interval size
  4. Control Fields (CF)
    • Control Interval Definition Field(CIDF)
      • Length:- 4 bytes long
      • Contains information about free space within CI
      • One CIDF per control interval
    • Records Definition Field(RDF)
      • Length:- 3 bytes long
      • It is primarily used to hold Record Length information, but if subsequent records are of same length then instead of repeating RDFs for each record, just one extra RDF is used to hold info describing number of adjacent records that have same length
      • Thus, for fixed length records, there will be two RDF. One describing number of records in CI and another one to specify the record length
      • For variable length records, the number of RDF can vary depending upon how many adjacent records have same length in the CI. If no two adjacent records are of same length, then one RDF is required to describe each record
      • Inserted from right to left because records are inserted from left to right

RDF Examples:-

Example 1: In below case, there are fixed length records (of 80 bytes) and thus only two RDF needed, one for storing length of record i.e. 80 and one more RDF is used to store how many records of same length i.e. 3 in our case

Example 2: In below case, All records are of variable length, thus it required separate RDF for each record

Example 3: In below case, 2 records are of variable length and 3 records are of fixed length, thus it 4 RDF, out of which 2 RDFs are used for two variable length record and rest two RDFs are used for fixed length record

 

Control Area (CA)

  • Control Area is collection of control intervals (Please refer figure below)
  • Many logical data records form a Control Interval and many Control Intervals form a Control Area (CA)
  • Control Area is stored on fixed-length contiguous area of DASD storage
  • CA is VSAM’s internal unit for allocating space within a cluster
  • Minimum size of CA is 1 track and maximum size is 1 cylinder
  • There can be one or more CA for a dataset depending on the number of records






© copyright mainframebug.com
Privacy Policy