Вы находитесь на странице: 1из 18

VSAM

(VIRTUAL STORAGE ACCESS METHOD)

VSAM:
VSAM is an IBM disk file storage method , first used in the OS/VS1, OS/VS2 Release 1 (SVS) and Release 2 (MVS) operating systems, later used throughout the Multiple Virtual Storage (MVS) architectu re and now in z/OS.

VSAM DATASET ORGANIZATIONS ESDS KSDS RRDS VRRDS LDS Entry Sequenced Data Set Key Sequenced Data Set (Fixed Length) Relative Record Data Set Variable Length Relative Record Data Set Linear Data Set

VSAM Dataset Organizations


ESDS Entry Sequenced Data Set

KSDS
RRDS VRRDS LDS

Key Sequenced Data Set


(Fixed Length) Relative Record Data Set Variable Length Relative Record Data Set Linear Data Set
3

Conventional (non-VSAM) access methods generally provide only a single type of dataset organization. VSAM provides three:

Key Sequenced Data Set (KSDS) : Where each record is identified for access by specifying its key

value - a sequence of characters embedded in each data record which uniquely identify that
record from all other records in the dataset.

Entry Sequenced Data Set (ESDS) , where each record is identified for access by specifying its physical location - the byte address of the first data byte of each record in relationship to the beginning of the dataset.

Relative Record Data Set (RRDS), where each record is identified for access by specifying its
record number - the sequence number relative to the first record in the dataset.

NON-VSAM Access Methods

BSAM : Basic Sequential Access Method

QSAM : Queued Sequential Access Method


ISAM : Indexed Sequential Access Method

BDAM : Basic Direct Access Method

VSAM Characteristics
VSAM supports three types of data access: Sequential, Random (also called Direct access) and Skip Sequential Protection of data against unauthorized access is an inherent part of VSAM

Easily portable to AS/400, the PC or non-IBM computers (cross system compatibility)

VSAM Characteristics (Contd.)


Options for optimizing performance

A multifunction service program (Access Method Services IDCAMS) for setting up catalog records and maintaining data sets A format for storing data independently of the type of direct access storage device on which it is stored

VSAM Terminology

Catalog Management
Logical Record

Record management Data component Master/User Catalog Data Space Control Interval and

Key Field
Physical Record Cluster Index Component

Control Area

Catalog Management : VSAM maintains extensive information about data sets and direct access storage space in an integrated catalog facility (ICF) catalog. All VSAM files must be defined in an ICF catalog.

Record Management : The record management part of VSAM contains the access method code

Logical Record : A logical record maintains a logical relationship among all the data items in the records. It is the way the programmer or user sees the data.

Physical Record : It implies the actual storage of data i.e where the data is
stored physically on the disk. Key Field : Identifies the item associated with the logical record.

Cluster : Collection of physical datasets that make up one logical data set.

Control Intervals

In non-VSAM data management methods, the unit of data that is moved between memory and the storage device is defined by the block.
In VSAM, it is defined as a control interval. A control interval contains records, control information. When a VSAM dataset is loaded, control intervals are created and records are written into them. With KSDS clusters, the entire control interval is usually not filled. Some percentage of free space is left available for expansion. With ESDS clusters, each control interval is completely filled before records are written into the next control interval in sequence. With RRDS clusters, control intervals are filled with fixed-length slots, each containing either an active record or a dummy record. Slots containing dummy records are available for use when new records are added to the dataset.
10

Control Areas:
Control intervals are grouped together into control areas. For ESDS and RRDS clusters, control areas are filled with control intervals that contain records. For KSDS clusters, some of the control intervals in each control area may consist entirely of free space that can be used for dataset expansion.

ESDS CA Structure

12

13

VSAM & NON-VSAM CATALOGS The catalog keeps track of the unit and volume on which the dataset resides and can be used for later retrieval of the dataset.

Non-VSAM dataset is created by means of the DISP=(,CATLG) JCL entry.


With VSAM datasets, creation of a catalog entry to record the unit and volume is mandatory.

Catalog entries for non-VSAM datasets were contained in OS CVOLS (operating system control volumes).
VSAM maintains its own catalog, also used to contain the catalog entries for nonVSAM datasets. On the latest versions of OS/390 and z/OS, ICF (Integrated Catalog Facility) catalogs are the only type of catalogs supported.

14

DEFINING A VSAM CLUSTER DEFINE CLUSTER (NAME(entryname) {CYLINDERS(primary] secondary]) |

RECORDS(primary[ secondary]) |
TRACKS(primary[ secondary])} VOLUMES(volser[ volser...]) [BUFFERSPACE(size)] [ERASE | NOERASE] [FILE(ddname)] [FREESPACE(CI-percent[ CA-percent]|0 0)]

15

[INDEXED | NONINDEXED | NUMBERED] [KEYS(length offset|64 0)] [MODEL(entryname[/password][ catname[/password]])] [REPLICATE | NOREPLICATE] [REUSE | NOREUSE]

[SPEED | RECOVERY]
[TO(date) | FOR(days)] [UNIQUE | SUBALLOCATION] [DATA ([NAME(entryname)]) [INDEX ([NAME(entryname)])

16

EXAMPLE :

17

THANK YOU

18

Вам также может понравиться