Wednesday, May 27, 2009

2. VSAM Catalogs

VSAM is totally catalog-driven. Catalogs are special purpose files residing on DASD (Direct Access Storage Device) serving as a central repository for information about all datasets under its control. There are two types of catalogs used • Master catalog • User catalog There’s only one Master catalog per system. The entries in the master catalog may point to VSAM or non-VSAM dataset, user catalogs, system datasets or other objects. User catalogs contain same type of information as master catalog. All user catalogs must be cataloged into master catalog. Access to a dataset can only be made through a master or user catalog. Therefore all VSAM datasets have to be cataloged. Non-VSAM datasets can also be cataloged. Catalogs are protected by RACF. Figure 2.1 VSAM Catalog Vsam catalog Catalogs maintain the following information • Name and physical location of datasets • password information required to access protected datasets • Statistics about datasets Example No. of records added, read, deleted or no. of Control Interval/Control Area splits • Information about dataset itself Example ESDS, KSDS, RRDS, CSIZE, KEYLENGTH • Location of catalog recovery area Vsam records VSAM records can be fixed or variable length. Records can also be spanned Vsam space allocation VSAM space allocation depends on whether the dataset is cataloged in an ICF or the older VSAM type catalog. For VSAM datasets cataloged in the newer ICF-type catalogs, dedicated space is allocated dynamically when the cluster is created with the DEFINE CLUSTER command Each VSAM dataset cataloged in an ICF catalog has its own VTOC entry. These VSAM datasets can have 1 primary and 122 secondary allocation unlike OS dataset which can have only 1 primary and 15 secondary extends on a volume. Vsam space management VSAM maintains detailed information in its catalogs about DASD space allocated to VSAM files. This allocation information stored in the catalog is more comprehensive and flexible than the equivalent information stored for a non-VSAM file in VTOC. Sub Allocation Once the space has been allocated, VSAM has complete control over subsequent allocations within that space. Within that space, VSAM can create suballocated files. Whenever a suballocated files need to be created, extended or deleted, VSAM uses it own space management facilities. Unique Allocation Alternatively an entire VSAM space can be allocated to single VSAM file. In that case allocation for the file called UNIQUE file, is managed by DADSM rather than by VSAM. Allocation information for the unique files is maintained in two places : the VSAM catalog entry for the file and the VTOC entry for the space that contains unique file. The figure below shows two DASD volumes. The first volume has a VSAM dataspace contains two sub-allocated files. Notice that there’s unused space within the dataspace too. However, that space is not available to non-VSAM files because it’s already under VSAM’s control. The second DASD volume contains two unique VSAM datasets. All of the unused space on the volume is available to both VSAM and Non-VSAM datasets. Under VSE/VSAM & OS/VS VSAM most VSAM datasets are sub-allocated. Under ICF, there is no VSAM space. All VSAM files are Unique Figure 2.2 Space Allocation

Back to VSAM index

No comments: