You are on page 1of 25

VSAM concepts and terminology

Virtual Storage Access Method


Access Method
Interface between application program and Operating System Facilitates data access Most widely used access method on IBM mainframes Designed to operate in a virtual storage environment Handles all I/O requests to Operating System No physical I/O is done if record is all ready in virtual storage

VSAM

Terminology
Files or data sets familiar concepts VSAM files referred to a a cluster
Need to DEFINE CLUSTER when defining VSAM files

Requires no special COBOL coding


Except for little used VSAM sequential files

Virtual Storage Access Method VSAM Dataset Types


Entry-sequenced ESDS
Stored in order written may/not be ordered by a key field Non-VSAM sequential datasets just as efficient ASSIGN clause requires AS-ddname

Virtual Storage Access Method VSAM- Dataset Types


Key-sequenced KSDS
Consists of two parts
Index containing key and pointer to record location Data records stored in primary key sequence

Can be accessed Sequentially or Randomly Significant improvement over legacy ISAM files

Relative-record RRDS
Records accessed by relative record numbers Can be accessed Sequentially or Randomly

An employee file with Entry-sequenced (ESDS) organization

An employee file with key-sequenced (KSDS ) organization

Relative Record Data Set (RRDS)

VSAM Record Management


Integrated Catalog Facility ICF
Used to keep track of files on the system There is one Master Catalog Can be many User Catalogs Access Method Services general purpose VSAM file management program
IDCAMS

VSAM Record Management


Control Intervals
Used to store in fixed length blocks of Logical records All physical I/O is carried out at the Control Interval level

Control Intervals exist within Control Areas


CA is usually one cylinder on the disk

Free space can be allocated to both CA and CI

VSAM uses the free space when adding new records

ICF - The relationships among the master catalog, user catalogs, and data sets

VSAM datasets are referred to a clusters


Records are grouped together in control intervals, and control intervals are grouped together in control areas

The structure of a control interval for fixed length records 10 bytes is reserved for Control Information

Control Interval Size


Increments of 512 (Up to 8192 bytes)
512 1024 1536 2048 2560 3072 3584 4096 4608 5120 5632 6144 6656 7168 7680 8192

Increments of 2048 (Over 8192 bytes)


10240 12288 14336 16384 18432 20480 22528 24576 26624 28672 30720 32768

Assume a record size of 300 bytes 300 / 4086 = 13 records 3900/4086 = 95%

Match your record size to valid sizes for control intervals that will maximize storage efficiency

Record organization in an ESDS

Components of a key-sequenced data set

Accessing a record in a key-sequenced data set

Free space distribution in the data component of a KSDS Need to Insert record 6047

Free space used to insert a record in the data component of a KSDS

Need to insert record 6046 ??

Free space used to insert a record in the data component of a KSDS

VSAM will split the control area if needed

Records are always kept in physical sequence

VSAM supports alternate indices with unique keys

VSAM supports alternate indices with non-unique keys

Next Time
Access Method Services

You might also like