Each record in KSDS will have a key-field. And the dataset to be defined with INDEXED parameter that amplify the speed.

Key sequenced Dataset (KSDS)

A key-sequenced data set is a type of data set where each record is identified by a key. The key is a field in a predefined position within the record.

Also read: How to give a dummy VSAM dataset

Each key must be unique in the KSDS data set.

Tip-To find the physical location of a record in a KSDS: VSAM creates and maintains an index. it relates the key of each record to the record’s relative location in the data set. When you add or delete records, this index is updated accordingly.”

With releases of DFSMS/MVS 1.4 and later, it is possible to have a data set that exceeds 4 GB in size. This can be achieved by defining the data set as an extended format with extended addressability in the corresponding storage class.

VSAM Files in CICS

In CICS, KSDS data sets can have extended attributes in both RL (Read-Log) and non-RLS (Non-Read-Log) mode. This information is from IBM.

VSAM KSDS

VSAM KSDS Benefits

  • As KSDS files are defined with an index, all the records can be read using key-value dynamically
  • You can define alternate keys, and these need not be unique.
  • You can access more than one record with an alternate key
  • You can define AIX also called alternative index. Records stored here in sequential order
  • CICS supports extensively both kinds of files. I mean, RLS and non-RLS files

The syntax for KSDS in COBOL

For primary key:

RECORD KEY IS data-name

For Alternative key:

ALTERNATE RECORD KEY IS data-name

Related