Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 16

VSAM

VSAM
What is VSAM?
Virtual Storage Access Method.
High performance access method.
Used to organize, store, catalog, retrieve and delete datasets.
VSAM Dataset is also called as a CLUSTER.

VSAM
Types of VSAM Datasets
KSDS
ESDS
RRDS

LDS

VSAM
Advantages of VSAM
Data Access is faster, because of the way the VSAM
Datasets are organized.
Records are inserted in a more efficient manner, with less
organization required.
Physical deletion is possible and hence free space can be
reused.
Records can be accessed sequentially and randomly

VSAM
Disadvantages of VSAM
More storage space required as the control information is
also stored along with the data.

VSAM
Internal Organization of VSAM Dataset
Control Interval (CI)
Control Area (CA)
Free space in CI and CA

VSAM
Control Interval

Data

Free

RDF

CIDF

(multiple recs.)

Space

(one or more)

(4 bytes)

Data Actual data to be processed.

Free space Space available to be used as necessary


RDF Record Description Field
- Information about records within the data space
- Three bytes long
CIDF Control Interval Description Field
- Information about free space available within CI

VSAM
Control Area

Control

Record 1 Record 2 Free space RDF

CIDF

Area1

Record 3

RDF

CIDF

Control

Control Interval

RDF

CIDF

Free Space

Area2
Collection of Control Intervals.
Must contain at least 2 CIs.
Must be at least one track long
Maximum 1 cylinder

VSAM
Control Interval and Control Area Splits
Occurs only in KSDS
Occur as a result of record insertion.
Reorganization of data set is done automatically and is
transparent to the user.

VSAM
Other Features of VSAM
VSAM Datasets must be cataloged.
VSAM Datasets must reside in space specifically allocated
for VSAM Datasets.
Often, one or more volumes are allocated to VSAM
Datasets called as VSAM Data space.
VSAM Dataset must reside on Direct access volumes.

VSAM
Defining a KSDS Dataset
DEFINE CLUSTER
( NAME (LISAS.KSDS.CLUSTER)

VOLUME (CICA00)

CYLINDERS (3,1)

CISZ (4036)

FREESPACE (10,20)

KEYS (5,1)

RECORDSIZE (80,80)

VSAM
Defining a KSDS Dataset (CONTD)
DATA

( NAME (LISAS.KSDS.DATA))

INDEX

( NAME (LISAS.KSDS.INDEX

CISZ (2048) )

CATALOG (LISAS.USER.CATLG)

VSAM
Defining an ESDS Dataset
DEFINE CLUSTER
( NAME (LISAS.ESDS.CLUSTER)

VOLUME (CICA00)

CYLINDERS (3,1)

CISZ (4036)

FREESPACE (10,20)

NONINDEXED

RECORDSIZE (80,80)

VSAM
Defining an ESDS Dataset (CONTD)
DATA

( NAME (LISAS.ESDS.DATA))

CATALOG (LISAS.USER.CATLG)

VSAM
Loading VSAM Dataset
REPRO
Input file must be a KSDS, ESDS, RRDS, PS or
member of PDS.
Output fie must be KSDS, ESDS, RRDS, PS or member
of PDS.
Input file must be sorted on the prime key (for KSDS).
REPRO INFILE (ddname of input file)
OUTFILE (ddname of output file)

VSAM
Common Errors
IDC3003I Dataset not found or missed hyphen
IDC3013I Duplicate Dataset name
IDC3314I- Action error on xxx or Record xxx out of
sequence.

You might also like