KSDS
The most common VSAM dataset type, where every record has a unique key used to find it directly.
Also written key-sequenced dataset
KSDS stands for key-sequenced dataset. It is the VSAM type applications use most, because it matches how business data is actually accessed: by identifier.
Every record contains a key field in a fixed position, such as an account number, a customer reference or a policy number, and every key must be unique. VSAM maintains an index over those keys, so a program can ask for one record by key and get it without scanning anything.
Records are also held in key order, which means the dataset can still be read sequentially when needed, and a program can position itself at a key and read forward from there. That combination, direct access plus ordered sequential access, is what makes it so widely used.
Alternate indexes can be defined over other fields, allowing lookups by a secondary value such as a surname.
A COBOL program treats a KSDS as an indexed file, reading, writing, rewriting and deleting records by key. Defining and loading one is done with IDCAMS before the program ever runs.
Related terms
- VSAMA family of dataset types built for fast record access by key, used where applications need to look records up rather than read them in order.
- IDCAMSThe utility used to create, list, copy and delete datasets, and the standard tool for anything involving VSAM.
- COBOLThe programming language most business logic on the mainframe is written in. Verbose by design, and still running the world's payments.
- File descriptionThe FD entry in a COBOL program that describes a file's records, connecting the program to data supplied by the JCL.
- Primary keyThe column or columns that uniquely identify each row in a table, so no two rows share the same value.