VSAM consists of following components −
VSAM are the logical datasets for storing records and are known as clusters. A cluster is an association of the index, sequence set and data portions of the dataset. The space occupied by a VSAM cluster is divided in contiguous areas called Control Intervals. We will discuss about control intervals later in this module.
There are two main components in a VSAM cluster −
Index Component contains the index part. Index records are present in Index component. Using index component VSAM is able to retrieve records from the data component.
Data Component contains the data part. Actual data records are present in Data component.
Control Intervals (CI) in VSAM are equivalent to blocks for non-VSAM data sets. In non-VSAM methods, the unit of data is defined by the block. VSAM works with logical data area which is known as Control Intervals.
Control Intervals are the smallest unit of transfer between a disk and the operating system. Whenever a record is retrieved directly from the storage, the entire CI containing the record is read into VSAM Input-Output buffer. The desired record is then transferred to work area from VSAM buffer.
Control Interval consists of −
When a VSAM dataset is loaded, control intervals are created. The default Control Interval size is 4K bytes and it can extend up to 32K bytes.
Following is the description of terms used in above program −
R1..R5 − Records which are stored in Control Interval.
FS − FS is free space, which can be used for further expansion of dataset.
RDF − RDF is known as Record Definition Fields. RDF are 3 bytes long. It describes the length of records and tells how many adjacent records are of the same length.
CIDF − CIDF is known as Control Interval Definition Fields. CIDF are 4 bytes long and contain information about the Control Interval.
A Control Area (CA) is formed by putting together two or more Control Intervals. A VSAM dataset is composed of one or more Control Areas. The size of VSAM is always a multiple of its Control Area. VSAM files are extended in units of Control Areas.
Following is the example of Control Area −