Sunday, August 3, 2014

Reading/Interpret the LISTCAT command output in VSAM

When we create a VSAM,all its details are recorded in the catalog table in MVS. LISTCAT is a versatile command meaning 'List Catalog'. LISTCAT  command can be fired from command  shell (option 6 from ISPF menu ) or it can run in batch as a SYSIN parameter to the IDCAMS.

To run it from the command shell , go to option 6 and give 
We will get the information's being displayed on the screen page by page as we hit enter.

To use it in batch we need the IDCAMS utility . Below is the sample JCL for LISTCAT command 
//SYSPRINT DD SYSOUT=*                          
//SYSIN    DD *                                    

Interpreting the LISTCAT command
Interpreting the listcat command

As we can see here the name of the cluster is TST.MYVSAM.DEPT.As we go through the spool we will see the information of  STORAGECLASS,MANAGEMENTCLASS, but those things are not of that much importance to us now. Go on and have a look down for

It implies that this VSAM is not password protected. Also the ASSOCIATIONS parameter will list down all the datasets with the same name pattern and we can see that it shows the data component and INDEX component. So our VSAM is probably a KSDS.
Look in the ATTRIBUTES Section.
ATTRIBUTES section will give a more clear picture on the VSAM definition, ie how it is defined .
So, from these statistics we can somewhat guess the definition.Like, for the above VSAM, the key is of length 16 and offset of the key position being 20.
((RKP parameter defines the relative position  of the key field in the base cluster.) )
The AVGLRECL and MAXLRECL will give us the  idea about the record size parameter used in definition which in this case is  191 and 1500 respectively.
SPEED and NOERASE are also keywords in VSAM world.
One more 'NONSPANNED' , specifies that the data in the component can not span across CIs
So from this screenshot lets note down what all information we collected
SHR(2 3)
RECORDSIZE(191 01500)
KEYS(00016 00020)

If we look a little right on the mainframe screen we will get the information about the CI size .

 So, the CISZ parameter will be of length 18432.  CISZ(18432).
Also , watch the parameter NOREUSE and UNORDERED. So three more features added to our cart for the vsam statistics; CISZ(18432) ,NOREUSE and UNORDERED
The CI/CA in VSAM indicates the number of CI in each CA .Thus the above information tell us that there are 45 CIs in each CA.
Go on for few more details in the STATISTICS section
This Section really gives us all the details regarding the statistics of the vsam in that moment. Will see more in details later. As of now check out the FREESPACE parameter % CI and % CA. Those are the parameters with which the vsam has been defined.
Ohh..!! one more i got in the Allocation section.
SPACE-PRI    -------60
SPACE-SEC   -------10
This is more or less self explanatory, ie, the allocation quantity is CYLLNDER and primary and secondary allocations are 60 and 10 respectively.
So few more added in our cart.
FREESPACE(025  008)
CYL(00000060  00000010) 
Some other useful information from STATISTICS section
1. (( FREESPC --16386048 : This indicates space in bytes in completely free CIs. Do not mix them up unused space in in CIs) )
2. REC-TOTAL :Total number of logical records in the data component in that instance listcat was run.
3. REC-INSERTED: Total number of logical records inserted in data component ,since the vsam was last created or re-organized.
4. REC-RETRIEVED : total logical records read from data part since its creation or reorganized.It takes into account  reads for update during REWRITE processing.
5. REC-UPDATED : Total number of logical records UPDATED or REWRITTEN back into the data component since its last creation or last it was reorganized. Does not include DELETED records.However if  a records is updated, and may be got deleted later ,is counted here.
6. SPLITS-CA /SPLITS-CI : Total number of CI and CA splits that happened since it was last created or reorganized.
Having covered all these till now, if we look into the VSAM parameters which we collected till now  ( highlighted in blue above), we can some what figure out the structure of the VSAM which will be like:
DEFINE CLUSTER (          -
   SHR(2 3)               -
   RECORDSIZE(191 01500)  -
   NOREUSE                -
   INDEXED                -
   NOERASE                -
   UNORDERED              -
   NONSPANNED             -
   SPEED                  -
      DATA               -
       (                           -
       VOLUMES(XXXX)               -
       CISZ(18432)                 -
       KEYS(00016 00020)           -
       FREESPACE(025  008)         -
       CYL(00000060  00000010)     -
        )                          -
       INDEX                       -
       (                            -
       VOLUMES(XXXXX)              -

No comments:

Post a Comment