VSAM
VSAM
Questions,VSAM Questions
What is a sequence set?
What is the index set?
Suppose 3 generations of a GDG exist. How would you reference the 1st
generation in
the JCL ?
What is an alternate index and path ?
How many buffers are allotted to VSAM KSDS and ESDS ?
What is the biggest disadvantage of using a VSAM dataset ?
What is free space?
What is a VSAM split?
What is the base cluster?
Do primary key values have to be unique? Do alternate key values have to
be unique?
In the COBOL SELECT statement what is the ORGANIZATION for a KSDS?
In the COBOL SELECT statement for a KSDS what are the three
possibilities for ACCESS?
What is the COBOL RECORD KEY clause?
What is the purpose of the FILE STATUS clause in the SELECT statement?
If you wish to use the REWRITE command haw must the VSAM file be
opened?
Explain the meaning and syntax for the START command.
What is the meaning of dynamic processing
Name some common VSAM error conditions and codes.
Primary INDEX ?
What is RECOVERY and SPEED parameters in DEFINE CLUSTER command ?
What is the difference between LDS and ESDS ?
Is a delete operation possible in an ESDS ? B, is rewrite operation possible
in ESDS ?
What is the device independent method to indicate where a Record is
Stored ?
How many times secondary space allocated ?
What is the RRN for the first record in RRDS ?
What is a Base Cluster ?
If FSPC(100 100) is specified does it mean that both the control interval
and control area will be left empty because 100 % of both CI and CA are
specified
to be empty ?
What is a sequence set?
What is a VSAM split?
What is the base cluster?
What is IDCAMS ?
Can AMS commands be run from the TSO prompt ?
Syntax of AMS modal commands ?
How do you decide on optimum values for CI, FREESPACE etc ... ?
Would you specify FREESPACE CE for an ESDS ?
What is SHAREOPTS ?
Name some common VSAM error conditions and codes.
What are the three levels of definition for the VSAM DEFINE?
What is the significance of the SHAREOPTIONS parameter?
What is the meaning of the DEFINE MODEL parameter?
What is File Status in VSAM ?
Under IDCAMS, multiple functions can be executed, each of which returns
a condition
code. What will be the condition code returned to the operating system ?
What is Control Interval, Control Area ?
What is FREESPACE ?
What is the meaning of each of the values in SHAREOPTS (2 3) ?
How do you define a kSDS ?
How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS
program's ?
What happens when you open an empty VSAM file in a COBOL program for
input ?
How do you initialize a VSAM file before any operation ? a VSAM with
alternate
index ?
What does a file status of 02 on a VSAM indicate ?
How do you calculate record size of an alternate cluster ? Give your values
for both
unique and nonunique.
What is the difference between sequential files and ESDS files ?
How do you load a VSAM data set with records ?
How do you define a GDG ?
What is the device independent method to indicate where a Record is
Stored ?
pgm, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS... ALTERNATE
RECORD KEY IS..
Using alternate indexes in CICS pgms:
FCT entries must be created for both base cluster & the path. To read using the
alternate index, use the dd name of the path in CICS file control commands.
4 is same as 3, which refreshes the buffer with every random access. Default is SHR
(1 3).
What are the optional parameters to the input DataSet While loading the
empty cluster with the data records?
i) Skip and Count
Syntax:
SKIP(2)
COUNT(4)
In this case, the first two records are skipped and the next four records are printed.
The
default for SKIP is 0, and for COUNT will be printing records from beginning to end.
ii) FromKey and ToKey
PRINT INDATASET (CUSTOMER.KSDS.CLUSTER) FROMKEY (111111) TOKEY (444444)
Will print all records with Key value ranging from 111111 to 444444.
iii) FROMADDRESS and TOADDRESS
iv) FROMNUMBER and TONUMBER
What does GDG mean in VSAM?
Generation Data Group
Is a delete operation possible in an ESDS? Is rewrite operation possible in
ESDS ?
No. Delete operation is not possible in VSAM ESDS. Yes, rewrite operation is possible
in an
ESDS.
Can VSAM files be deleted with the DELETE option of the DISPOSITION
parameter of JCL?
No, you have to give a separate DELETE command in the VSAM cluster.
How many buffers are allocated to VSAM KSDS and ESDS?
2 data buffers by default for ESDS. For KSDS it allots 2 data buffers and 1 index
buffers. Each
buffer is about 4k.
What are the codes returned by the AMS (Access Method Services)
command during the execution?
Every AMS command issues a condition code. If multiple commands are being
executed
Successively, there might be a requirement to execute or bypass certain commands
on the
Success or failure of a previous command.
The normal condition codes returned by AMS commands are :
0 - The function was executed successfully
4 - A problem was encountered while executing the function, WARNING
8 - The requested function was executed, but major specifies were unavoidably
bypassed,
ERROR
12 - The requested command could not be performed because of a logical error,
SEVERE
16 - A severe error occurred causing the remainder of the command stream to be
bypassed., FATAL.
What are the 3 types of VSAM files ?
1-ESDS (Entry sequenced dataset). DB2 uses a special type of ESDS.
2-RRDS (Relative record dataset). Records are accessed using a relative number.
3-KSDS (Key sequenced dataset) is the most common type encountered. The record
sequence is determined by a unique key field.
How do you create a VSAM file ?
You use the IDCAMS utility with the DEFINE CLUSTER option.
How do you copy to a VSAM cluster ?
You use the IDCAMS utility with the REPRO option.
An additional parameter, NONINDEXED is used to tell AMS that an ESDS is being allocated.
How is LDS different from ESDS?
An LDS is a data set; very similar to an ESDS without the control information .It has no records
and used for fast random access. It takes advantages of the computers very fast paging
hardware for retrieval and storage and the bytes are implicitly divided into 4K blocks or pages,
and the paging hardware reads and writes blocks from disk. There is no free space, unused
space, control field in LDS.
What is a CI, Control Interval?
A Control Interval is the unit of information that VSAM transfers between virtual and auxiliary
storage.
What is a CA, control area?
A group of Control Intervals makes up a control area.
What is Control Interval Split?
A new record stored in same CI, only if there is enough space. If not VSAM locates the free CI
within the same CA, moves approximately half of the records to next CI and stores the new
record at the correct position. This is called Control Interval Split. Whenever CI split occurs the
sequence set is updated.
If the records are larger than the CI size, for ex. if a record extend CI boundary and
extends unto 3 CI, and there is still some space left in last i.e. third CI, will that be used by
other CI Datasets ?
NO. Some records are larger than the CI size, the records extend across CI boundaries (only for
ESDS and KSDS). A spanned record begins on a CI boundary and it occupies two or more CIs in
a CA. The unused space in the last CI can only be used to extend the record, it cannot
contain any other record i.e. a new record has to be added in a new CI.
What is a sequence set?
This is the part of the index that points to the CA and CI of the record being accessed.
What is a cluster?
A cluster is the combination of the index, sequence set and data portions of the Dataset. The
operating system gives program access to the cluster, i.e. to all parts of the Dataset
simultaneously.
What is the index set?
This is the other part of the index. It has multiple levels with pointers that ultimately reach to the
sequence set.
What is a Catalog?
The catalog contains the names of all Datasets, VSAM and non-VSAM. It is used to access these
Datasets.
What is an alternate index?
An AIX is a file that allows access to a VSAM Dataset by a Key other than the primary one. The
Alternate Key-pointer pair records are stored in an index cluster. This index cluster is known as
Alternate index. The alternate Key-pointer pair records are loaded into the alternate index cluster
by the command BLDINDEX.AIX can be built over a KSDS and ESDS, but not over an RRDS.
What could be the maximum number of the AIXs per base cluster?
There can be a maximum of 253 AIXs per base cluster. It is not advisable to have more than 5
AIXs per base cluster because of additional overhead during updates and retrievals.
Can AIX be defined over an ESDS, which does not have any Key?
Although an ESDS does not have a primary Key, an AIX can be defined over an ESDS. In the
case of an ESDS it is the relative byte address of the corresponding record in the base cluster
that is stored.
Can we access records in VSAM only by a single Key, i.e. primary Key?
It is also possible to access the records in a sequence other than that of the primary Key. Such
Keys are called alternate Keys and they can be non-unique.
For Example, in a pay-roll system where employee number is the unique primary Key and the
Employee name as alternate Key.
What is the 'verify' command in the VSAM files?
This command is used to close those files that are kept open after the abnormal termination of
the file. It also brings the index component in sync with the data components and updates the
catalog.
What is a path?
A path is a file that allows you to access a file by alternate index - the path provides an
association between the AIX and the base cluster.
updated.
What is free space?
Free space is reserved within the data component of a KSDS to accommodate
inserting new
records.
What is IDCAMS? and what is the purpose of it?.
IDCAMS, also known as Access Method Services, is used to perform the following
tasks:
Create a VSAM data set, VSAM alternate index, or catalog.
List a catalog entry for a data set, Dataset/catalog contents.
Copy a Dataset or catalog.
Convert non-VSAM to VSAM data set.
Load a VSAM Dataset from VSAM records
Rename VSAM data sets.
What is a VSAM split?
If there isn't enough space in the Control Interval VSAM performs a Control Interval
split by
moving some records to the free Control Intervals. If there isn't a free Control
Interval VSAM
performs a control area split by allocating a new control area and moving half of the
Control
Intervals to it.
What is the base cluster?
The base cluster consists of the data component and the index component for the
primary index
of a KSDS.
What will happen if there is no secondary allocation made for Datasets?
VSAM will inform COBOL program of the problem and terminate the processing of
the program.
Why CI and CA splits are not possible in ESDS and RRDS?
In ESDS the new record is added at the end of last record. And no imbedded free
space is
allocated at the time of Dataset definition. In the case of RRDS the slots for the
records are pre-allocated and so the CI and CA split is not possible.
Do primary Key values have to be unique? Do alternate Key values have to
be
Unique?
Primary Key values must be unique; alternate Key values need not be.