Virtual storage access method (VSAM) is a disk storage access method that was developed by IBM. It first saw use in the OS/VS2 operating system and then was ported over to multiple virtual storage (MVS). Since then, it has moved to the z/OS. VSAM is made up of four different data set organizations. They are: Key Sequenced Data Set (KSDS), Relative Record Data Set (RRDS), Entry Sequenced Data Set (ESDS) and Linear Data Set (LDS). The first three contain records, but the last one which was added at a later time contains bytes with no intrinsic record.
VSAM Files
The different data sets differ tremendously from organization to organization. VSAM data is comprised of control intervals (CI) and control area (CA). The size of the CI and the CA depends entirely on the access method employed. The user never sees the way in which they are used.
A control interval can typically hold multiple records. The way the records are stored is from the lowest address and then ranked up. On the other hand, control information is stored from the highest address down. Free space is all the space that is between the records and the control information. The control information can be further broken down into two types:
- Control Interval Descriptor Field: Always present.
- Record Descriptor Field: Present when records are within the CI.
It is important to note that all free space is contiguous. Therefore, when a record is added to the CI, all of the records are organized so that the record is added in the right slot. On the flip side, should a record be deleted, the record above it will slide down one spot. Because of the need to keep all free space contiguous, the records constantly move when new ones are added or removed.
When there is no longer any free space available, the CI splits. This results in two CIs being in a CA that now hold records. The new CI comes from a pool of unused CIs and half the records from the original CI are transferred to the second one. When this happens, the records on the original CI have to organize so that they go from lowest address and then up.
