Youtube

Go to The Main Page Add Youtube to favorite!

VSAM 

Virtual storage access method (VSAM) is an IBM disk file storage access method, first used in the OS/VS2 operating system, later used throughout the Multiple Virtual Storage (MVS) architecture and now in z/OS. Originally a record-oriented filesystem, VSAM comprises four data set organizations: Key Sequenced Data Set (KSDS), Relative Record Data Set (RRDS), Entry Sequenced Data Set (ESDS) and Linear Data Set (LDS). The KSDS, RRDS and ESDS organizations contain records, while the LDS organization (added later to VSAM) simply contains a sequence of bytes with no intrinsic record structure.

IBM uses the term data set in official documentation as a synonym of file, and DASD instead of disk drive.

VSAM records can be of fixed or variable length. They are organised in fixed-size blocks called Control Intervals (CIs), and then into larger divisions called Control Areas (CAs). Control Interval sizes are measured in bytes — for example 4 kilobytes — while Control Area sizes are measured in disk tracks or cylinders. Control Intervals are the units of transfer between disk and computer so a read request will read one complete Control Interval. Control Areas are the units of allocation so, when a VSAM data set is defined, an integral number of Control Areas will be allocated.

The Access Method Services utility program IDCAMS is commonly used to manipulate ("delete and define") VSAM data sets. Custom programs can access VSAM datasets through data definitions (DDs) in Job Control Language (JCL) or in online regions such as in Customer Information Control Systems (CICS).

Both IMS/DB and DB2 are implemented on top of VSAM and use its underlying data structures.

Contents

VSAM files

The physical organization of VSAM data sets differs considerably from the organizations used by other access methods.

VSAM data sets are held in control intervals (CI) and control areas (CA). The size of the CI and CA is normally determined by the access method, and the way in which they are used is not visible to the user.

You can use three types of file organization with VSAM:

VSAM sequential file organization

Also referred to as VSAM ESDS (entry-sequenced data set) organization, VSAM sequential file records are stored in the order in which they were entered.

VSAM entry-sequenced data sets are equivalent to QSAM sequential files. The order of the records is fixed.

VSAM indexed file organization

Also referred to as VSAM KSDS (key-sequenced data set) organization, VSAM indexed file records are ordered according to the collating sequence of a user-defined embedded prime key field. The prime key consists of one or more consecutive characters in the records. It uniquely identifies the record and determines the sequence in which it is accessed with respect to other records. The most important that has to be noted while going for the KSDS is that, the key value has to be in a sorted order in the file. A prime key for a record might be, for example, an employee number or an invoice number.

VSAM relative file organization

Also referred to as VSAM fixed-length or variable-length RRDS (relative-record data set) organization, VSAM relative file records are ordered by their relative key. The relative key is the relative record number, which represents the location of the record relative to where the file begins. The relative record number identifies the fixed- or variable-length record.

In a VSAM fixed-length RRDS, records are placed in a series of fixed-length slots in storage. Each slot is associated with a relative record number. For example, in a fixed-length RRDS containing 10 slots, the first slot has a relative record number of one, and the tenth slot has a relative record number of 10.

In a VSAM variable-length RRDS, the records are ordered according to their relative record number. Records are stored and retrieved according to the relative record number that you set.

Throughout this documentation, the term VSAM relative-record data set (or RRDS) is used to mean both relative-record data sets with fixed-length records and with variable-length records, unless they need to be differentiated.

VSAM Data Access Techniques

There are three types of access technique for VSAM data:

Each is optimised for different access patterns. For example, LSR is optimised for "random" or direct access, whereas NSR is optimised for sequential access.

Another difference is that some access techniques are more available than others for specific execution and programming environments. For example, LSR access is easy to achieve from CICS while NSR access has historically been easier to use than LSR for batch programs.

See also

References

Could not update stat
UP