Mainframes 360
The one stop destination for System Z professionals

Tuesday, July 28, 2009

MVS System Catalog – Finding information about VSAM Cluster from the Catalog


Q. What’s a System Catalog? Why have one?
A Catalog is like an address book. A real-life address book stores the names of people, and their addresses(where they live/reside, where they work etc..). In a Mainframe System, there are many files(Datasets), that live in different areas of Memory(Storage). Each dataset is found in a different area/location. If you wanted to find a particular dataset, do anything with it, read it, update it etc., you would need to lookup where the dataset is. How do you know, in this vast expanse of storage space consisting several DASD Devices, each having many volumes, where your dataset lies. Its like finding a needle in a haystack.

Thanks to the MVS System Catalog. I call it the Address Book of the MVS O/S. You want to access a dataset, but don’t know where it is? Ask the System Catalog. The System Catalog tells you, where in the whole world of storage space, you dataset is..

Storage Devices like DASD are just like Hard-disk Drives. Inside, there are a no. of plates(platters)/circular disks. Each disk is called a volume. Every disk volume records information in tracks. These are just like the tracks on vinyl record/compact disk.

The Address Book of the MVS O/S – System Catalog stores the name of the dataset, along with the disk volume on which it resides.

Have you ever wondered, on Windows OS, why can't you have 2 files with the same name in a folder? In MVS O/S, on the same lines, you can't create two datasets with the same identical names. Its pretty easy to understand why. The MVS O/S keeps track of all the datasets. It stores information about the name of a dataset, and where this dataset is present on the disk(which volume). In other words, MVS O/S records the name and disk volume of the dataset.The list of all the datasets and their locations are stored in an area called MVS System Catalog. We say, that the dataset is cataloged. If MVS, does not have any information about the whereabouts of a dataset, that is it does not know, where to look for a dataset, we say that the dataset is un-cataloged.
Q. I would like to see what the MVS System Catalog looks like? How do see what’s in there?

When you would like to see(peek in) the entries of the MVS System Catalog, you must use the LISTCAT Command of the IDCAMS utility. In case of VSAM Files, the  MVS System Catalog also stores information about the Alternate Indexed, no. of records, control interval size, free space etc. So, you can find a lot meta-information(Information about data) for VSAM Files in the MVS System Catalog.

You can run LISTCAT from TSO. You must type TSO LISTCAT, and you can see the output.

The LISTCAT Command can be used to find the entries of the VSAM Cluster in the Catalog. So, if you want to see the entries of your VSAM file in the Catalog, you can use the LISTCAT AMS Control Statement. The LISTCAT Command has a few options :
1) ENTRIES - This is used to filter out the entry that you want to be listed.

For example, if you want to see all the catalog entries with the name CAA0176.DEMO.KSDS, you can code the ENTRIES option as

ENTRIES(CAA0176.DEMO.KSDS)

To code multiple files, you can simply put the continuation character :

ENTRIES(CAA0176.DEMO.KSDS1,          -
        CAA0176.DEMO.KSDS2,          -
        CAA0176.DEMO.KSDS3)

You can also make use of a generic name. Suppose, you wanted to list all entries in the catalog having the dataset names starting with CAA0176.DEMO.

ENTRIES(CAA0176.DEMO.*)

2) CLUSTER - This is used to specify that only the cluster entry is to be listed. If this is not mentioned, all the index entries would also be printed.
3) ALL - This means all field of the entry are to printed.

A Simple Batch JOB/JCL making use of the LISTCAT Command is shown here :

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
//LISTCAT3 JOB A123,QUASAR,NOTIFY=&SYSUID                              
//STEP1  EXEC  PGM=IDCAMS                                              
//SYSPRINT DD  DSN=CAA0176.DEMO.JOBLOG,DISP=(OLD,KEEP,KEEP)            
//SYSIN    DD    *                                                     
  LISTCAT -                                                            
        ENTRIES(CAA0176.DEMO.KSDS) -                                   
        CLUSTER -                                                      
        ALL                                                            
/*                                                                     


Upon submitting the above Batch JOB/JCL. the JOB Log shows the following information -

DCAMS  SYSTEM SERVICES                                           TIME:
  LISTCAT -                                                            
        ENTRIES(CAA0176.DEMO.KSDS) -                                   
        CLUSTER -                                                      
        ALL                                                            
CLUSTER ------- CAA0176.DEMO.KSDS                                      
     IN-CAT --- CATALOG.T.ICFTST03                                     
     HISTORY                                                           
       DATASET-OWNER-----(NULL)     CREATION--------2009.208           
       RELEASE----------------2     EXPIRATION------0000.000           
     SMSDATA                                                           
       STORAGECLASS -------WORK     MANAGEMENTCLASS---SORTMC           
       DATACLASS --------(NULL)     LBACKUP ---0000.000.0000           
       BWO STATUS------00000000     BWO TIMESTAMP---00000 00:00:00.0   
       BWO---------------(NULL)                                        
     RLSDATA                                                           
       LOG ----------------(NULL)   RECOVERY REQUIRED --(NO)     FRLOG -
       VSAM QUIESCED -------(NO)    RLS IN USE ---------(NO)           
       LOGSTREAMID-----------------------------(NULL)                  
       RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'                
       RECOVERY TIMESTAMP GMT-------X'0000000000000000'                
     PROTECTION-PSWD-----(NULL)     RACF----------------(NO)           
     ASSOCIATIONS                                                      
       DATA-----CAA0176.DEMO.KSDS.DATA                                 
       INDEX----CAA0176.DEMO.KSDS.INDEX                                
IDCAMS  SYSTEM SERVICES                                           TIME:
         THE NUMBER OF ENTRIES PROCESSED WAS:                          
                   AIX -------------------0                            
                   ALIAS -----------------0                            
                   CLUSTER ---------------1                            
                   DATA ------------------0                            
                   GDG -------------------0                            
                   INDEX -----------------0                            
                   NONVSAM ---------------0                            
                   PAGESPACE -------------0                            
                   PATH ------------------0                            
                   SPACE -----------------0                            
                   USERCATALOG -----------0                            
                   TAPELIBRARY -----------0                            
                   TAPEVOLUME ------------0                            
                   TOTAL -----------------1                            
         THE NUMBER OF PROTECTED ENTRIES SUPPRESSED WAS 0              
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0              
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0      


As you might notice, the above Catalog Entry gives all information like AIX, ALIAS, CLUSTER, DATA Cluster’s name, INDEX Cluster’s Name. Moreover, it also gives all the SMS-related(where on the disk this dataset resides) information.

To many people who are thrown to work at a mainframe computer on their first job, they feel lost. Mainframe people seem to speak a completely different language and that doesn't make life easy. What's more, the books and manuals are incredibly hard to comprehend.

"What on earth is a Mainframe?" is an absolute beginner's guide to mainframe computers. We'll introduce you to the hardware and peripherals. We'll talk about the operating system, the software installed on a mainframe. We'll also talk about the different people who work on a mainframe. In a nutshell, we'll de-mystify the mainframe.

Readers based in India, can buy the e-book for Rs. 50 only or the print book. International readers based in the US and other countries can click here to purchase the e-book.