In this Mainframe tutorial, you will learn about VSAM Catalogs, Master Catalog, User Catalog and Data Space of VSAM.
Master Catalog in VSAM is like captain of a ship, since all files used in VSAM is controlled by this master catalog. The attributes of files like password authorization for files, monitoring of operation performed on files, VSAM access for files, location of the file, space management of file, available free space in file are all monitored, managed and present in Master catalog. The above attributes are maintained and updated as and when the attributes of files changes like if the file gets updated, file expands in size and file size gets reduced keeping the master catalog always updated with current information and attributes of file.
There are many operations of the file during which the master catalogue is referred by VSAM for security. For instance one could be when a requested file is opened and closed. In this process of opening and closing the requested file the appropriate password is requested to the user and VSAM checks the associated master catalog entry for password verification before proceeding with the operations requested on the file, thereby enhancing the security. A vital point one must know is, the Master Catalog by itself is a file. The entries in this master catalog file would be system datasets and VSAM structures. All these help in monitoring and management operations of VSAM. The master catalog is defined using IDCAMS program. There would be only one master catalog for a VSAM system.
The User Catalog is present at the lower hierarchy of the Master Catalog and has the same structure and concepts as the master catalog. It is not that user catalogue must be made mandatory as master catalog but if present it would enhance the security of VSAM system. We saw in our earlier master catalog explanation that master catalog by itself is a file and would point to other files. But if user catalogues are defined master catalog would point to user catalog instead of pointing to VSAM files and these user catalogs would in turn point to VSAM files.
As we have seen before there would be only one master catalog for a VSAM system. But in contrast it is possible that a user catalog can be present in any number as needed for instance as in a production system which might have any number of user catalog as needed by the system. Also the structure of VSAM is such a way that even when the master catalog is destroyed, the user catalogs are not affected. Also even if the user catalog is destroyed only the files under that catalog will get destroyed, which enables rebuilding the catalog without much process and work on other files.
Master Catalog hierarchy is depicted in diagram below:
When a VSAM structure has user catalog and master catalog as shown above in the diagram then the request for a file would pass through different hierarchy as explained below. The file request will first pass through the master catalog, then through the user catalog present below the master catalogue and finally finish up on the third stage at the appropriate file.
VSAM Data Space
The data space is an area of the direct access storage device volume which is used by VSAM and hence called as VSAM data space. The data space need not occupy the entire volume of the direct access storage device volume. It is possible that it may occupy only a portion of the volume of direct access storage device volume or may occupy it fully as specified. For specifying this space allocation it must be defined in the catalog. Once the space occupation is specified in the catalog the VSAM takes control of this space and monitors and maintains this space as needed by VSAM files. This space must also be defined in the VTOC. The main difference in the name entry between VTOC and catalogue entry of files is that in case of VSAM catalog individual files will appear whereas in case of VTOC only the name given to the area of the entire VSAM data space will appear. In other words VTOC has entry of area occupied by space.
Defining of master catalog or a user catalog enables VSAM create a data space to hold the user catalog entries. In this allocation of the amount of space specified for the user catalog from the space available on the volume as a data space is made.
The relationship between the different VSAM catalogs is that, Master Catalog should contain pointers to the User Catalogs which is present in a lower hierarchy to the master catalog. Also all data sets cataloged in the user catalog should have a higher level qualifier equal to the name of the user catalog.