---
title: "Free Space in VSAM: KSDS Internal Architecture"
description: "A Key Sequenced Data Set (KSDS) improves data management and access performance through indexed components and free space utilization."
url: https://srinimf.com/2023/11/01/how-a-record-in-a-ksds-is-randomly-accessed-by-primary-key/
date: 2023-11-01
modified: 2026-10-05
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2023/11/pexels-photo-531844.jpeg?fit=1880%2C1253&ssl=1
categories: ["VSAM"]
tags: ["VSAM KSDS"]
type: post
lang: en
---

# Free Space in VSAM: KSDS Internal Architecture

A Key Sequenced Data Set (KSDS) has two parts: a data component and an index component. The index component includes an index set and a sequence set. Including free space can improve the performance of the KSDS.

![KSDS Free space](https://i0.wp.com/srinimf.com/wp-content/uploads/2015/08/pexels-photo-18069423.jpg?resize=1880%2C1058&ssl=1)*Photo by Google DeepMind on Pexels.com*

## KSDS Index

At the lowest level of the index is the sequence set. This set determines the control interval where a specific record is stored. On the other hand, the index set comprises records at multiple levels that direct to the sequence set records.

The entries in the **index set **record contain the highest key values stored in each of the **sequence set** records, and the entries in the sequence set records contain the highest key values stored in each of the control intervals.

## Random Access

To locate a particular record in VSAM, the system first searches through the index set to find the corresponding sequence set. From there, it looks for the control interval that contains the desired record and reads it into the virtual storage. Then, it searches through the keys of the records in that control interval until it finds the specific record.

## Free space

The free pointer shown in each **sequence set** record points to free control intervals in the control area. There is also control information within each control interval that identifies the [free space in the interval](https://www.ibm.com/docs/en/ims/15.1.0?topic=command-specifying-free-space-ksds-freespace-parameter).

By using the free pointers and control information, VSAM is able to manage the free space as it adds records to a KSDS.

VSAM updates the records in the index and sequence sets while adding them. This allows the dataset to be used for sequential and random processing using the primary key.

**Free space enhances performance by minimizing the chances of control interval and control area splits.**

## Performance

**To improve performance,** the systems programmer tries to define a production KSDS in a way the [index set](https://srinimf.com/2023/10/24/the-merits-of-vsam-alternate-index/) reads into internal storage areas (buffers). It is how it improves KSDS performance.

Related Posts

- [VSAM: KSDS, ESDS, LDS, RRDS Differences and Their Uses](https://srinimf.com/2012/05/16/vsam-ksds-esds-lds-rrds-and-their-uses/)DateMay 16, 2012
- [How to Read VSAM File Randomly in COBOL](https://srinimf.com/2020/03/29/7-quick-tips-on-mainframe-vsam-files/)DateMarch 29, 2020
- [VSAM Alternate Index: The Internal Process Details](https://srinimf.com/2015/12/01/5-must-know-tips-if-you-want-to-use-vsam-alternate-index/)DateDecember 1, 2015

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2023%2F11%2F01%2Fhow-a-record-in-a-ksds-is-randomly-accessed-by-primary-key%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2023%2F11%2Fpexels-photo-531844.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=Free%20Space%20in%20VSAM%3A%20KSDS%20Internal%20Architecture)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2023/11/01/how-a-record-in-a-ksds-is-randomly-accessed-by-primary-key/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2023/11/01/how-a-record-in-a-ksds-is-randomly-accessed-by-primary-key/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2023/11/01/how-a-record-in-a-ksds-is-randomly-accessed-by-primary-key/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2023/11/01/how-a-record-in-a-ksds-is-randomly-accessed-by-primary-key/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Free%20Space%20in%20VSAM%3A%20KSDS%20Internal%20Architecture&body=https%3A%2F%2Fsrinimf.com%2F2023%2F11%2F01%2Fhow-a-record-in-a-ksds-is-randomly-accessed-by-primary-key%2F&share=email)
-

### Like this:

Like Loading…