Sunday, June 10, 2007

VSAM

TIP # 059
VSAM

Performance Tuning
One can speed up applications greatly by using memory to cut I/O when dealing with VSAM
datasets.
For this VSAM Buffers can be enlarged.
In the DD statement code AMP parameters = BUFNI(index), BUFND(data), BUFSP ( amount of
virtual storage)
Increase number of Data buffers (BUFND) for sequential access
Increase number of Index buffers (BUFNI) for random access

TIP # 060
VSAM

IDCAMS Utility can't be executed without 2 DD Statements.
They are SYSPRINT and SYSIN.

TIP # 061
VSAM

We know that FREESPACE(100,100) specification causes one record to be written for each
Control interval, and one Control Interval would be written for each control area. But do you
know why?
VSAM will always load the first record before taking FREESPACE option into consideration!!!

TIP # 062
VSAM

DEFINE PATH command creates an alias for the VSAM base cluster
DEFINE ALIAS command creates an alias for non-VSAM datasets

TIP # 063
VSAM

CICS, DB2, IMS can process records in existing VSAM datasets but can't create the dataset.
Even you can process VSAM data sets in COBOL programs only
after you create them with access method services.

TIP # 064
VSAM

How can I specify dummy VSAM dataset in a JCL?
Code AMP=’AMORG’ . This parameter tells the OS to treat the file as VSAM file.
//NOVSAMIO DD DUMMY,AMP=’AMORG’

TIP # 065
VSAM

I want to process a KSDS thru an alternate key. Now what are the 5 IDCAMS commands that must be
executed before the records in a KSDS can be processed thru an alternate key?
1. DEFINE CLUSTER
2. REPRO (the base cluster must be non-empty KSDS)
3. DEFINE ALTERNATEINDEX
4. DEFINE PATH
5. BLDINDEX
The first 3 IDCAMS commands should be executed in the above-mentioned order.
The last 2 IDCAMS can be done in any order.

TIP # 066
VSAM

I want to make my VSAM dataset read-only. How can I do it?
By using INHIBIT along with ALTER command
e.g.,
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
ALTER -
SECRET.KSDS.DATA -
INHIBIT
ALTER -
SECRET.KSDS.INDEX -
INHIBIT
/*
//
Notice that the ALTER command is used with DATA and INDEX and not with the cluster.

TIP # 067
VSAM

VSAM equivalent of temp dataset is to create VSAM file with REUSE option. A dataset created with
REUSE can be treated as a new dataset at any subsequent time.

TIP # 068
VSAM

How should be VSAM file defined in order that it can be accessed both in CICS and in BATCH
environment?
Define as SHAREOPTION (2,3)

TIP # 069
VSAM

While designing VSAM files, what’s the best way to choose Control Interval (CI) size for the data and the
index?
Well, it depends on whether the data will be accessed directly or sequentially.
For Direct access use small CI
For Sequential access use Lager CI

2 comments:

Anonymous said...
This comment has been removed by the author.
Anonymous said...

VSAM Interview Questions in MNCs

http://www.aired.in/2009/09/vsam-interview-questions-in-mncs.html