VSAM Interview Questions & Answers

Virtual Storage Access Method (VSAM) is an IBM DASD file storage access method, first used in the OS/VS1, OS/VS2 Release 1 and Release 2 operating systems, later used throughout the Multiple Virtual Storage architecture and now in z/OS. Here you will find the most commonly asked VSAM interview questions with answers which are faced by interviewee. Also these questions will get you acquainted with the nature of the questions you may be ask during your interview.

1. What is VSAM?

Answer:- VSAM (Virtual Storage Access Method ) is an access method for IBM's mainframe operating system, MVS, now called z/OS. VSAM succeeded and expanded upon an earlier IBM file access method, ISAM (Indexed Sequential Access Method).
Using VSAM, an enterprise can organize records in a file in physical sequence (the sequential order that they were entered), logical sequence using a key (for example, the employee ID number), or by the relative record number on direct access storage devices.

2. What are dataset types in VSAM?

Answer:- The VSAM datasets are divided into four types based on the storage of data and accessing of data. They are :

1. Entry Sequential Dataset : ESDS is known as Entry Sequenced Data Set. An entry-sequenced data set behaves like sequential file organization with some more features included.
2. Key Sequential Dataset : KSDS is known as Key Sequenced Data Set. A key-sequenced data set (KSDS) is more complex than ESDS and RRDS but is more useful and versatile.
3. Relative Record Dataset : RRDS is known as Relative Record Data Set. RRDS cluster is similar to an ESDS cluster. The only difference is that RRDS records are accessed by Relative Record Number (RRN), we must code NUMBERED inside the DEFINE CLUSTER command.
4. Linear Dataset : LDS is known as Linear Data Set. Linear dataset is the only form of byte-stream dataset which is used in used in traditional operating system files. Linear datasets are rarely used.

3. Explain DEFINE CLUSTER command in VSAM?

Answer:- The DEFINE CLUSTER command creates a new VSAM data set. It creates the data and index files on the local machine and catalogs the data set name.
DEFINE CLUSTER is the command that is used to Create ESDS, KSDS and RRDS datasets.Note that each of the DEFINE commands has its own () , inside which all other parameters are mentioned.

4. How to Delete a Cluster in vsam?

Answer:- The DELETE command can be used to delete both VSAM and non-VSAM objects. To delete a VSAM file, the VSAM cluster needs to be deleted using IDCAMS utility. DELETE command removes the entry of the VSAM cluster from the catalog and optionally removes the file, thereby freeing up the space occupied by the object. If the VSAM data set is not expired then it will not be deleted. To delete such types of datasets use PURGE option.

5. What is REPRO Command?

Answer:- After we create the Clusters we can use them in our programs to load them. However we might need to load them initially from some PS datasets . This can be done using REPRO command. We can even copy normal files using REPRO command.

6. What are the advantages of VSAM?

Answer:- Below are the advantages of VSAM:

1. VSAM supports more dataset types.
2. Supports variety of I/O Techniques.
3. Improves Efficiency.
4. Access the records directly using the VSAM access method.
5. Records can be accessed sequentially or randomly.
6. Supports Batch and Online.
7. Deletion of records results in them being physically removed from DASD.

7. What are the disadvantages of VSAM ?

Answer:- Below are the disadvantages of VSAM: :

1. VSAM files can't be displayed and edited by ISPF, and it requires a tool to get them displayed and edited in ISPF.
2. Requires more DASD space.
3. Only works with data stored on disk and can't handle data stored on other devices like tapes, etc

8. What is Control Interval?

Answer:- Control Intervals (CI) in VSAM are equivalent to blocks for non-VSAM data sets. In non-VSAM methods, the unit of data is defined by the block. VSAM works with logical data area which is known as Control Intervals.
Control Intervals are the smallest unit of transfer between a disk and the operating system. Whenever a record is retrieved directly from the storage, the entire CI containing the record is read into VSAM Input-Output buffer. The desired record is then transferred to work area from VSAM buffer.

9. What is Fixed-length RRDS?

Answer:- RRDS has several fixed-length pre-formatted logical-record slots. Each slot has a unique Relative Record Number (RRN), varying from 1 to the maximum number of records in the dataset. The slots are arranged in ascending order based on RRN. The slots are grouped in CI(s).

10. What is Variable-length RRDS?

Answer:- VRRDS is like an RRDS, except it contains only variable-length records. VRRDS has no slots like RRDS. Each record has a unique Relative Record Number (RRN), and records are placed in ascending order of RRN. RRN is used to access the record from the VRRDS, and RRN can't get changed.

Also check :