A Community of and for MVS Programmers













VSAM Technical FAQ's

COBOL IMS VSAM
DB2 JCL CICS


Q What are the types of VSAM datasets ?
A Entry sequenced datasets (ESDS)
Key sequenced datasets (KSDS)
Relative record dataset (RRDS)
Linear datasets(LDS).
Q What is an ESDS ?
A Entry Sequenced Data Set is like a standard sequential data set.Its records are processed one at a time in the order in which they were loaded.
Q What is a KSDS ?
A A Key Sequenced Data Set is like an ISAM file, its records may be processed sequentially or randomly based on a key value. A KSDS is often called an indexed file.
Q What is a RRDS ?
A A Relative Record Data Set is like a nonVSAM relative file. Its records can be accessed based on their relative positions in the file.
Q What is a LDS ?
A A VSAM data set that contains data but no control information. A linear data set can be accessed as a byte-addressable string in virtual storage.
Q What is a CONTROL INTERVAL (CI) ?
A A unit of data that is transferred between auxiliary storage and virtual storage when an I/O request is made. It contains records, free space and control information.
Q Explain the information contained in CI ?
A Control information consists of RDF (Record Descriptor Field) and CIDF (Control Interval Descriptor Field). Every CI contains one CIDF which is a field consisting of the last 4 bytes of a CI. It contains information about the offset and the length of free space in the CI. In case of fixed size records each CI contains two RDF's and each RDF is 3 bytes in length. In case of the variable size records,there is a separate RDF for each record in the CI. The size of the Data portion of the CI should be multiple of 512 bytes or 2,048 bytes. Max size of the CI is 32K. The size of the index portion of CI could be one of the following: 512, 1024, 2048, 4096.
Q What is a CA, control area ?
A A group of control intervals makes up a control area.
Q What is a sequence set ?
A Sequence set is the part of the index that points to the CA and CI of the record being accessed.
Q What is an index set ?
A Index set is the other part of the index. It has multiple levels with pointers that ultimately reach to the sequence set.
Q What is a CI SPLIT ?
A The movement of some records from an existing CI to another free CI in the same CA because a record add or update cannot be accommodated in the existing one. This results in two half-empty CI's instead of one full and one empty CI. CI split require a number of I/O operations and this degrades the performance of the VSAM file. A right amount of the space should be allocated for the CI (internal percentage of free space allocation).
Q What is a CA SPLIT ?
A The movement of the half of the records in an existing CA to a new CA because a record add or update cannot be accommodated in the existing CA. This results in two approximately half-full CA's instead of one full and one empty CA. This is very unsufisient because it involves a lot of I/O operations.
Q What is an Alternate index ?
A An AIX is a file that allows access to a VSAM dataset by a key other than the primary one.
Q What is Free space ?
A Free space is reserved within the data component of a KSDS to accommodate inserting new records and the updating of records.
Q What is a RECORD KEY ?
A 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.
Q What is the purpose of the START command ?
A To position a current record pointer on a desired record. This command should be followed by a Read statement which bring that record into the pgm.
Q Name some common VSAM error conditions and codes.
A Common Error codes are: End of file (10), Duplicate key (22), Record not found (23), VSAM logic error (92) and Resource not available (93).
Q What are the IDCAMS commands that can be used for VSAM and explain each of them.
A ALTER modifies information for a catalog, alternate index, cluster or path. BLDINDEX builds the alternate index, ofcourse. DEFINE is used for ALTERNATEINDEX, CLUSTER or PATH. DELETE removes the catalog entry for a catalog, cluster, alternate index or path. LISTCAT lists information about the dataset. PRINT prints the dataset contents. REPRO copies records from one file to another.
Q What is the purpose of the VERIFY function of IDCAMS ?
A The purpose of verify is to re-sync the end of file info with the catalog info.
Q In the COBOL SELECT statement what is the ORGANIZATION for a KSDS ?
A The Organization is INDEXED.
Q In the COBOL SELECT statement for a KSDS what are the three possibilities for ACCESS ?
A ACCESS can be SEQUENTIAL, RANDOM or DYNAMIC.
Q How can you find out information about VSAM Clusters in a Catalog ?
A This information is listed in the report produced by Listcat Entries function of the IDCAMS utility.
Q What is the relation between the Master Catalog, User Catalog, and Data Sets which could be cataloged in the User Catalog ?
A Master Catalog should contain pointers to the User Catalogs. All data sets cataloged in the user catalog should have a higher level qualifier equal to the name of the user catalog.
Q If you wish to use the REWRITE command how should the VSAM file be opened ?
A It must be opened as I/O.
Q What is the significance of the SHAREOPTIONS parameter ?
A It specifies how the file may be shared between jobs and between batch and CICS environments and between systems.
Q What is the meaning of the DEFINE MODEL parameter ?
A The MODEL parameter allows you to model your cluster by modelling it after an existing cluster.
Q How can you find out what is the amount of unused space for a specific VSAM cluster ?
A Compare Higher allocated RBA with Higher used RBA in the Listcat function listing.





Home | Help Boards | Contact Us | News | Top

© 2002, MVSFORUMS. All Rights Reserved.