VIRTUAL STORAGE ACCESS METHOD (VSAM) is an
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 Definition (DD) statements in Job Control Language (JCL), via dynamic allocation or in online regions such as in Customer Information Control System (CICS).
* 1 VSAM files
* 1.1 Sequential VSAM organization * 1.2 Indexed VSAM organization * 1.3 Relative VSAM organization * 1.4 Linear VSAM organization
* 2 VSAM Data Access Techniques * 3 Sharing VSAM data * 4 History * 5 See also * 6 Notes * 7 References
The physical organization of VSAM data sets differs considerably from the organizations used by other access methods, as follows.
VSAM data sets consist of 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. There will be a fixed number of control intervals in each control area.
A control interval normally contains multiple records. The records are stored within the control interval starting from the low address upwards. Control information is stored at the other end of the control interval, starting from the high address and moving downwards. The space between the records and the control information is free space. The control information comprises two types of entry: a control interval descriptor field (CIDF) which is always present, and record descriptor fields (RDF) which are present when there are records within the control interval and describe the length of the associated record. Free space within a CI is always contiguous.
When records are inserted into a control interval, they are placed in the correct order relative to other records. This may require records to be moved out of the way inside the control interval. Conversely, when a record is deleted, later records are moved down so that the free space remains contiguous. If there is not enough free space in a control interval for a record to be inserted, the control interval is split. Roughly half the records are stored in the original control interval while the remaining records are moved into a new control interval. The new control interval is taken from a pool of free control intervals within the same control area as the original control interval. If there is no remaining free control interval within that control area, the control area itself is split and the control intervals are distributed equally between the old and the new control areas.
You can use three types of record-orientated file organization with VSAM (the contents of linear data sets have no record structure):
SEQUENTIAL VSAM ORGANIZATION
Further information: Entry Sequenced Data Set
An ESDS may have an index defined to it to enable access via keys, by defining an Alternate Index. Records in ESDS are stored in order in which they are written by address access. Records are loaded irrespective of their contents and their byte addresses cannot be changed.
INDEXED VSAM ORGANIZATION
Further information: Key Sequenced Data Set
A KSDS has two parts: the index component and the data component. These may be stored on separate disk volumes.
While a basic KSDS only has one key (the primary key), alternate indices may be defined to permit the use of additional fields as secondary keys. An Alternate Index (AIX) is itself a KSDS.
The data structure used by a KSDS is nowadays known as a
RELATIVE VSAM ORGANIZATION
Further information: Relative Record Data Set
An RRDS may have an index defined to it to enable access via keys, by defining an Alternate Index.
LINEAR VSAM ORGANIZATION
Further information: Linear Data Set
An LDS is an unstructured VSAM dataset with a control interval size of a multiple of 4K. It is used by certain system services.
VSAM DATA ACCESS TECHNIQUES
There are four types of access techniques for VSAM data:
* Local Shared Resources (LSR), is optimised for "random" or direct
access. LSR access is easy to achieve from
SHARING VSAM DATA
Sharing of VSAM data between
VSAM was introduced as a replacement for older access methods and was
intended to add function, to be easier to use and to overcome problems
of performance and device-dependence. VSAM was introduced in the 1970s
The KSDS organization was designed to replace
ISAM , the Indexed
Sequential Access Method. Changes in disk technology had meant that
searching for data in
ISAM data sets had become very inefficient. It
was also difficult to move
ISAM data sets as there were embedded
pointers to physical disk locations which became invalid if the data
set was moved.
The RRDS organization was designed to replace BDAM , the Basic Direct Access Method. In some cases, BDAM data sets contained embedded pointers which prevented them from being moved. However, most BDAM data sets did not and the incentive to move from BDAM to VSAM RRDS was much less compelling than that to move from ISAM to VSAM KSDS.
Linear data sets were added later, followed by VSAM RLS and then Transactional VSAM.
* ^ No longer used. * ^ A B With the exception of catalogs, page spaces and swap spaces, which unauthorized applications could access only via specialized OS services. Not to mention the fact that it's been in VSE for ever too and is used in z/VSE
* VSAM Demystified * DFSMStvs Overview and Planning Guide
* v * t * e
OS/360 and successors
* EXCP * EXCPVR * STARTIO
* BTAM * QTAM * TCAM * VTAM
* * <