Catalog
When a dataset is used, it always refers to its name without the information where the dataset is stored. There should be someplace where this linking information should save. The catalog concept was invented to resolve this issue.
Catalog structure has the below components -
- Catalog
- Data Space
- Unique Clusters
- Non-VSAM Datasets
The below diagram shows the catalog structure and its components.
Catalog -
- Catalog maintains the dataset information like unit and volumes on which the dataset is located. It uses the same information while retrieving the data from the dataset.
- Datasets can be cataloged (while creating VSAM dataset), uncataloged (while deleting VSAM dataset), or recataloged (while creating the deleted VSAM dataset again).
- All system-managed datasets stored on DISKs are cataloged automatically in a catalog.
- By default, VSAM dataset information is stored in the catalog because it stores on DISKs only and is not optional for VSAM datasets. Whereas non-VSAM dataset information does not.
- However, the user has an option, DISP=(, CATLG) JCL entry creates the catalog entry for the non-VSAM dataset.
All Catalogs are classified into two types, and those are -
- Master Catalog
- User Catalogs
Master Catalog -
- The Master Catalog stores only the dataset high-level qualifier with the name of the user catalog, which has the location of all the datasets information.
- Every mainframe (z/OS) system that uses VSAM has at least one master catalog.
- The master catalog was created during the system design process and is usually stored on system residence volume.
- The master catalog "owns" all other VSAMs datasets information on the system. Because of this, the master catalog was called "VSAM King" in the 1970s.
For example -
In the above example, CATALOG.Z113.MASTER is a catalog, storing in a catalog CATALOG.Z113.MASTER and it is Master Catalog.
User Catalog -
- A User Catalog is a catalog that contains the name and location of a dataset (DSN / VOLUME / UNIT).
- The user catalog contains the application-specific datasets information (entries).
- The PROD system might have many user catalogs based on the application type.
For example -
Let us assume CATALOG.Z113.USERCTLG is a catalog stored in CATALOG.Z113.MASTER, then CATALOG.Z113.USERCTLG is user catalog.
VSAM Data Space -
- Data Space is up to two GB of contiguous virtual storage memory that a program can directly control through assembler instructions.
- A data space contains only data and does not contain common areas, system data, or programs.
- The data space and catalog relationship get established when the VSAM dataset is defined on volume.
- The catalog owns the data space once it links to the VSAM dataset.
- A catalog can have multiple data spaces on the same or different volumes and it explains where and how much data space is available.
- VSAM automatically updates the data space information in the catalog once data space is allocated to a file.
Unique Clusters -
- A Cluster should be unique in association with the index and data components of the dataset.
- Every VSAM file type (ESDS, KSDS, RRDS, LDS) has a cluster (base) component and a data component.
- The cluster name must be different from the data component.
The three components of the VSAM dataset are -
- Base Component - Specifies the name of the VSAM file.
- Data Component - Data records are present in the data component of a VSAM cluster.
- Index Component - Index records are present in the index component of a VSAM key-sequenced cluster.
For example -
MATEGJ.TEST.VSAM - Cluster Component
MATEGJ.TEST.VSAM.DATA - Data Component
MATEGJ.TEST.VSAM.INDEX - Index Component
ESDS, fixed RRDS, LDS has a cluster base and data component.
For example -
MATEGJ.TEST.VSAM - Cluster Component
MATEGJ.TEST.VSAM.DATA - Data Component
For KSDS or variable-length RRDS, the cluster component has the data and index component.
For example -
MATEGJ.TEST.VSAM - Cluster Component
MATEGJ.TEST.VSAM.DATA - Data Component
MATEGJ.TEST.VSAM.INDEX - Index Component
Non-VSAM Datasets -
- Non-VSAM datasets (stored on both tape and disk) may have entries in the master catalog and user catalogs.
- The non-VSAM dataset may have less information than the VSAM dataset in catalogs.