In order to access data on a disk, a programmer normally invokes an access method. By using one of the commercially available access methods the programmer is relieved of the many complex and intricate details required to store and retrieve data from disk.
A D V E R T I S E M E N T
Some of these details include setting record size, determination of available disk space for record storage, writing data to the disk, locating data on disk and retrieving data from the disk. Without an available access method, the programmer would be required to write enormous amounts of code in each program to write and retrieve data from a disk. The importance of choosing a powerful and reliable access method must be given high priority in the field of information processing.
The structure of VSAM evolves around four basic concepts: the master catalog, the user catalog, the data space and , of course, the file itself which is commonly referred to as a cluster.
The master catalog is a required file which must be defined using the IDCAMS program. Every file which is to be used must be under the control of the master catalog. The information stored for each file allows for VSAM access to the file, password authorization and statistics for the many operations which may be performed on the file. In addition, the master catalog contains information concerning the physical environment of the VSAM files which include the type of DASD being used and the location of and allocation of available free space. This information, of course is kept current as files are expanded, reduced, created or deleted. Through the master catalog, VSAM is capable of organizing and distributing the DASD space which has been allocated. VSAM, upon request from an application program will locate, open and close a requested file and in doing so will check passwords and insure that the master catalog information is correct as it pertains to the requested file. Since the master catalog is itself a file, it must be provided the required DLBL an EXTENT statements under DOS/VSE. During IPL, the supervisor is informed of the existence of the master catalog through the CAT command and the master catalog is always assigned the system logical unit SYSCAT. The file-id and the appropriate volume containing the master catalog must be placed on the DLBL and EXTENT statements for the file. The DLBL must specify IJSYSCT as the filename and both the DLBL and EXTENT statements are normally stored in the standard label cylinder.
User catalogs are not required in a VSAM installation but their use is encouraged to provide better data integrity and security. The user catalogs have the same structure and contain most of the same information as the master catalog but appear at a lower level then the master catalog. When user catalogs are being used, the master catalog will point to the appropriate user catalog instead of pointing to the file. The user catalog will then point to the VSAM file. One may think of this as a three level access path. As evidenced in figure 1, the file request will pass through the master catalog on the first level, the user catalog on the second level and finally finish up on the third level at the proper file. The usefulness of implementing user catalogs is that if a user catalog gets destroyed (or partially destroyed) only the files under that catalog will be affected. Therefore, the catalog can be rebuilt without affecting the vast majority of files (and users). Likewise, if the master catalog is destroyed, the user catalogs are not affected. The benefits of implementing user catalogs in a VSAM environment obviously outweigh the additional overhead costs which include extra space and a more complex file access path.
The area on a DASD volume which is allocated to VSAM is called the VSAM data space. This data space may occupy the entire volume or may simply occupy a portion of a specific volume. This space must be defined to the catalog through an Access Method Service command and must be define on the VTOC of the system. By defining this space to the catalog, you are giving VSAM complete control of this area. VSAM will then manage this space according to the requirements of the files when they are created. One interesting note is that the individual files will be defined in the appropriate VSAM catalog but each file will not appear on the VTOC. Instead, the name given to the area of the entire VSAM data space will appear on the VTOC. This area will, more than likely, contain many VSAM files