Virtual storage access method
Encyclopedia
Virtual storage access method (VSAM) an IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 disk file storage access method
Access method
An access method is a function of a mainframe operating system that enables access to data on disk, tape or other external devices. They were introduced in 1963 in IBM OS/360 operating system...

, first used in the OS/VS1
OS/VS1
Operating System/Virtual Storage 1, or OS/VS1,was an IBM mainframe computer operating system designed to be run on IBM System/370 hardware....

, OS/VS2 Release 1
OS/VS2 (SVS)
Single Virtual Storage refers to Release 1 of Operating System/Virtual Storage 2 ; it is the successor system to the MVTBut not 65MP option of Operating System/360...

 (SVS) and Release 2
MVS
Multiple Virtual Storage, more commonly called MVS, was the most commonly used operating system on the System/370 and System/390 IBM mainframe computers...

 (MVS) operating systems, later used throughout the Multiple Virtual Storage (MVS) architecture and now in z/OS
Z/OS
z/OS is a 64-bit operating system for mainframe computers, produced by IBM. It derives from and is the successor to OS/390, which in turn followed a string of MVS versions.Starting with earliest:*OS/VS2 Release 2 through Release 3.8...

. Originally a record-oriented filesystem
Record-oriented filesystem
In computer science, a record-oriented filesystem is a file system where files are stored as collections of records. There are several different record formats; the details vary depending on the particular system...

., VSAM comprises four data set
Data set (IBM mainframe)
data set , dataset , is a computer file having a record organization. The term pertains to the IBM mainframe operating system line, starting with OS/360, and is still used by its successors, including the current z/OS. Those systems historically preferred this term over a file...

 organizations: Key Sequenced Data Set
Key Sequenced Data Set
A Key Sequenced Data Set is a type of data set used by the IBM VSAM computer data storage system. Each record in a KSDS data file is embedded with a unique key. A KSDS consists of two parts, the data component and a separate index file known as the index component which allows the system to...

 (KSDS), Relative Record Data Set
Relative Record Data Set
A Relative Record Data Set is a type of data set used by the VSAM computer data storage system. Records are accessed based on their ordinal position in the file...

 (RRDS), Entry Sequenced Data Set
Entry Sequenced Data Set
An Entry Sequenced Data Set is a type of data set used by the VSAM computer data storage system. Records are accessed based on their sequential order, that is, the order in which they were written to the file; which means that accessing a particular record involves searching all the records...

 (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 pages with no intrinsic record structure, for use as a memory-mapped file
Memory-mapped file
A memory-mapped file is a segment of virtual memory which has been assigned a direct byte-for-byte correlation with some portion of a file or file-like resource. This resource is typically a file that is physically present on-disk, but can also be a device, shared memory object, or other resource...

.

IBM uses the term data set in official documentation as a synonym of file, and Direct access storage device
Direct access storage device
In mainframe computers and some minicomputers, a direct access storage device, or DASD , is any secondary storage device which has relatively low access time relative to its capacity....

(DASD) because it supported other devices similar to disk drives.

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 kilobyte
Kilobyte
The kilobyte is a multiple of the unit byte for digital information. Although the prefix kilo- means 1000, the term kilobyte and symbol KB have historically been used to refer to either 1024 bytes or 1000 bytes, dependent upon context, in the fields of computer science and information...

s — 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
Job Control Language
Job Control Language is a scripting language used on IBM mainframe operating systems to instruct the system on how to run a batch job or start a subsystem....

 (JCL), via dynamic allocation or in online regions such as in Customer Information Control Systems
CICS
Customer Information Control System is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE.CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive , but background transactions are possible...

 (CICS).

Both IMS/DB and DB2
IBM DB2
The IBM DB2 Enterprise Server Edition is a relational model database server developed by IBM. It primarily runs on Unix , Linux, IBM i , z/OS and Windows servers. DB2 also powers the different IBM InfoSphere Warehouse editions...

 are implemented on top of VSAM and use its underlying data structure
Data structure
In computer science, a data structure is a particular way of storing and organizing data in a computer so that it can be used efficiently.Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks...

s.

VSAM files

The physical organization of VSAM data sets differs considerably from the organizations used by other access methods is 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 that records have to be moved up 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):

Indexed VSAM organization

A KSDS has two parts: the index component and the data component. These may be stored on separate disk volumes.

A KSDS may have more than one key. A secondary key is provided by an alternate index which is itself a KSDS.

The data structure used by a KSDS is nowadays known as a B+ tree
B+ tree
In computer science, a B+ tree or B plus tree is a type of tree which represents sorted data in a way that allows for efficient insertion, retrieval and removal of records, each of which is identified by a key. It is a dynamic, multilevel index, with maximum and minimum bounds on the number of...

.

Linear VSAM organization

An LDS is an unstructured VSAM dataset with a CISZ of a multiple of 4K. It is used by certain system services.

VSAM Data Access Techniques

There are three types of access technique for VSAM data:
  • Local Shared Resources (LSR)
  • Global Shared Resources (GSR)
  • Non-Shared Resources (NSR)


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
CICS
Customer Information Control System is a transaction server that runs primarily on IBM mainframe systems under z/OS and z/VSE.CICS is a transaction manager designed for rapid, high-volume online processing. This processing is mostly interactive , but background transactions are possible...

 while NSR access has historically been easier to use than LSR for batch programs.

Sharing VSAM data

Sharing of VSAM data between CICS regions can be done by VSAM Record-Level Sharing (RLS). This adds record caching and, more importantly, record locking. Logging and commit processing remain the responsibility of CICS which means that sharing of VSAM data outside a CICS environment is severely restricted.

Sharing between CICS regions and batch jobs requires Transactional VSAM, DFSMStvs. This is an optional program that builds on VSAM RLS by adding logging and two-phase commit, using underlying z/OS system services. This permits generalised sharing of VSAM data.

History

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 when IBM announced virtual storage
Virtual storage
Virtual storage can refer to:* virtual memory; IBM uses "virtual storage" rather than "virtual memory"* The storage seen by clients when storage virtualization is used...

 operating systems (DOS/VS, OS/VS1 and OS/VS2) for its new System/370 series, as successors of the DOS/360 and OS/360
OS/360 and successors
OS/360, officially known as IBM System/360 Operating System, was a batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was heavily influenced by the earlier IBSYS/IBJOB and Input/Output Control System packages...

 operating systems running on its System/360 computer series. While backwards compatibility was maintained, the older access methods suffered from performance problems due to the address translation required for virtual storage.

The KSDS organization was designed to replace ISAM
ISAM
ISAM stands for Indexed Sequential Access Method, a method for indexing data for fast retrieval. ISAM was originally developed by IBM for mainframe computers...

, 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 imbedded 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 imbedded 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.

See also

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK