In this topic, we described about the below sections -
A component is an individual element of a VSAM data set. Each component has an entry, a name in the catalog, and an entry in the VTOC. A component can be multi-extent and multi-volume.
VSAM dataset has three components, and those are -
- Data component
- Index component
For example -
MATEGJ.TEST.VSAM - Cluster Component MATEGJ.TEST.VSAM.DATA - Data Component MATEGJ.TEST.VSAM.INDEX - Index Component
A cluster is an association of the index, sequence set, and data portions of the dataset. A VSAM cluster is a logical definition for the VSAM data set of any type.
Every VSAM file type has a cluster (base) component and a data component. The cluster name must be different from the data component. For KSDS or variable-length RRDS, the cluster component has the index component along with the data component.
VSAM entry-sequenced, key-sequenced, and relative-record data sets can define clusters using access method services (IDCAMS).
DEFINE CLUSTER access-method services used to define VSAM data sets (clusters) with data and index components.
Defining VSAM datasets involves creating an entry in an integrated catalog without any data transfer.
The below information is mandatory to create the dataset -
- Name of the entry
- Name of the catalog to contain this definition
- Organization (sequential, indexed, or relative)
- Device and volumes that the data set will occupy
- Space required for the data set
- Record size and control interval sizes (CISIZE)
Data component -
VSAM Data component is a collection of the data records. These data records can be small or large that might spread across control intervals and control areas.
Every VSAM organization or file type (ESDS, KSDS, RRDS, VRRDS, LDS) has a data component. The data component is part of the VSAM dataset, alternate index, or catalog.
Index component -
The index component is a collection of logical records contains the key fields/RBA of data records. These keys collect from the fixed defined field in each logical data record.
Using the index, VSAM can randomly retrieve the record from the data component.
VSAM index can have more than one level, and each level contains the pointers to the next lower level.
All the index CIs have only one logical record, which is made of fields. The fields are called as index entries. The keys in logical records compressed or RBA pointers are compacted.
Because of sequential or random access, VSAM divides the index CIs into two parts, and those are -
- Sequence set
- Index set
The sequence set is the lowest level of the index, and it contains primary keys and pointers to the control intervals of the data component. There is one sequence set for one control area (CA).
Every CIs highest record key is stored in a sequence set. The highest record key of the sequence set stores in the first level of the index set.
Based on the size of the index component CI, there can be 1-3 levels of index sets in the index component of the dataset.