VSAM Questions and Answers
VSAM Questions and Answers
Question: How do you fix the problem associated with VSAM out of space
condition?
Answer: 1. Define new VSAM dataset allocated with more space. 2. Use
IDCAMS to REPRO the old VSAM file to new VSAM dataset. 3. Use IDCAMS to
ALTER / rename the old VSAM dataset or se IDCAMS to DELETE the old VSAM
dataset. 4. Use IDCAMS to ALTER / rename the new VSAM dataset to the
name of the original VSAM dataset.
Question: How many buffers are allotted to VSAM KSDS and ESDS?
Answer: 2 data buffers by default for ESDS. For KSDS it allots 2 data buffers
and 1 index buffers. Each buffer is about 4k.
Question: 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?
Answer: no, they would not be left empty. One record will be written in each
CI and 1 CI will be written for each CA.
- VSAM data space has to exist on the desired volume, if not, IDCAMS
DEFINE SPACE function should be executed for that volume, and then next
functions:
- DEFINE CLUSTER;
- REPRO - will load VSAM Cluster from another VSAM file or sequential file.
14. What can you delete thru the usage of IDCAMS DELETE function?
- It is used to delete VSAM and non VSAM objects such as clusters, alternate
indexes, and paths. VSAM data space can also be deleted.
- Record Key indicates to the system where in the record of the VSAM file the
key is located. Record key should be described in the File Section.
19. How can you change a record from the VSAM file?
- Move Tr-Key to Record-Key field;
21. What should be done in a pgm to delete a record from the VSAM file?
- Move Tr-Key to Record-Key field;
- Delete a record;
- Check for file status (acceptable values of the status are:
00 - successful and
23 - record not found.
In any other case pgm should be terminated).
23. Describe the sequence of steps when base cluster is being accessed
through the alternate Index?
25. How can you process VSAM file sequentially trough the Alternate Index?
- The pgm has to use a START command which names the Alternate Index;
- The pgm has to use a Read New Record command with at end option:
(Read VSAM-Master Next Record at end Perform At-End-Processing).
27. How can you find out what is the amount of unused space for a specific
VSAM cluster?
-Compare higher allocated RBA with Higher used RBA Listcat function listing.
28. How can you find out the number of CI and CA splits for specific VSAM
cluster?
- This information is listed in the report produced by Listcat Entries
function of the IDCAMS pgm.
What is FREESPACE ?
What is SHAREOPTS ?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can
be shared among users. It is coded as SHAREOPTS(a b), where a is the
cross region share option ie how two or more jobs on a single system can
share the file, while b is the cross system share option ie how two or
more jobs on different MVSes can share the file. Usual value is (2 3).
How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS
pgms ?
DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify
the base cluster name, KEYS, RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or
NONUNIQUEKEY), DATA(ds name for the data component), INDEX(ds name for
the index component).
Then DEFINE PATH. Important paramters are NAME (ds name for the path),
PATHENTRY (ds name of the alternate index name), UPDATE(or NOUPDATE)
which specifies whether an alt index is updated when a update to the
base cluster takes place.
Then BLDINDEX. Parameters are INDATASET(ds name of base cluster),
OUTDATASET(ds name of AIX).
What happens when you open an empty VSAM file in a COBOL program for
input?
A VSAM file that has never contained a record is treated as unavailable.
Attempting to open for input will fail. An empty file can be opened for
output only. When you open for output, COBOL will write a dummy record
to the file & then delete it out.
How do you initialize a VSAM file before any operation? A VSAM with
alternate index?
Can write a dummy program that just opens the file for output & then
closes it.
What more info you should give in the DD statement while defining the
next generation of a GDG?
Give (+1) as the generation number, give (new,catlg) for disp, give
space parameter, can give the dcb parameter if you want to override the
dcb of the model dataset.
Assuming that the DEFINE jcl is not available, how do you get info about
a VSAM file's organisation ?
Use the LISTCAT command.