LISTCAT command.


LISTCAT command in IDCAMS:

·        The LISTCAT command is provided to list the information from catalog entries.

·        It is almost always a good idea to list the catalog entries for objects immediately following their creation to visually verify that all of the options you intended to specify were entered correctly and had the desired effect on the entry created.

·        Syntax:
LISTCAT
    [ALIAS] │
    [ALTERNATEINDEX] │
    [CLUSTER] │
    [DATA] │
    [GENERATIONDATAGROUP] │
    [INDEX] │
    [NONVSAM] │
    [PAGESPACE] │
    [PATH] │
    [SPACE] │
    [USERCATALOG]

    [CREATION(days)]
    [ENTRIES(entry name[/password] [ entryname[/password]...])  |
        LEVEL(level)]
    [EXPIRATION(days)]
    [NAME  |  HISTORY  |   VOLUME  |  ALLOCATION  |  ALL]
    [OUTFILE(ddname)]

    [CATALOG(catname[/password])] 

·        All LIST CAT parameters are optional.
·        1st Group specifies the type of catalog entry to the searched.
IF nothing is specified all the catalog entry types will be searched.

·        CREATION indicates the number of days; entries are listed only if they were created the specified number of days ago or earlier.

·        EXPIRATION also specifies a number of days; entries are listed only if they will expire in the specified number of days or earlier.

·        The parameters NAME, HISTORY, VOLUME, ALLOCATION, and ALL specify the type of information to list for catalog entries. 
§  NAME (the default) specifies that only the name
§  HISTORY specifies that the name, entry type, ownerid, creation date, and expiration date should be listed. 
§  VOLUME specifies that all information listed by the HISTORY parameter, plus the volume serial numbers and device type
§  ALLOCATION specifies that all information listed by the VOLUME parameter, plus the detail information about space allocation should be listed. 
§  ALL specifies that all information from the catalog entry should be listed.

·        OUTFILE may be used to specify that the output from the LISTCAT command should be written to a DD name other than SYSPRINT.

·        The objects to the listed can be specified using either ENTRIES or LEVEL.


§  ENTRIESà The names of one or more objects can be included as subparameters of the ENTRIES parameter  . It is also possible to use generic names to select groups of entries based upon the structure of their names.  A generic name uses an asterisk (*) instead of a node name at one or more levels to refer to objects that have any node names at that level.  

§  LEVELà The LEVEL provides an alternative for specifying a generic name.  When one or more initial qualifiers are specified in a LEVEL parameter, the parameter refers to all objects whose names begin with the specified qualifiers, no matter how long their names are.

‘*’ and LEVEL are used to search based on the high - level qualifiers.

***************************** Top of Data *****************
//JOB00010 JOB (XXXX),'ACCESS METHOD',NOTIFY=SYSUID       
//STEP0001 EXEC PGM=IDCAMS                                
//SYSPRINT DD   SYSOUT=*                                  
//SYSIN    DD *                                           
     LISTCAT NAME LEVEL(SM017R.TEST)                      
/*                                                        
**************************** Bottom of Data ***************

This list names of all the datasets starting with SM017r.TEST.
All the entries having this as HLQ will be displayed.

NONVSAM ------- SM017R.TEST.BAKUP.JCL      
      IN-CAT --- SYS1.TSO8A.CATALOG         
                                             
 NONVSAM ------- SM017R.TEST.CNTLCARD       
      IN-CAT --- SYS1.TSO8A.CATALOG         
                                            
 NONVSAM ------- SM017R.TEST.CTC            
      IN-CAT --- SYS1.TSO8A.CATALOG         
                                            
 NONVSAM ------- SM017R.TEST.JCL            
      IN-CAT --- SYS1.TSO8A.CATALOG         
                                            
 NONVSAM ------- SM017R.TEST.PROCLIB        
      IN-CAT --- SYS1.TSO8A.CATALOG         
                                            
 GDG BASE ------ SM017R.TEST.SAMPLE.BASE    
      IN-CAT --- SYS1.TSO8A.CATALOG         
.
.
.
.
.
.
THE NUMBER OF ENTRIES PROCESSED WAS:
           AIX -------------------0  
           ALIAS -----------------0  
           CLUSTER ---------------3  
           DATA ------------------3  
           GDG -------------------1  
           INDEX -----------------2  
           NONVSAM ---------------8  
           PAGESPACE -------------0  
           PATH ------------------0  
           SPACE -----------------0  
           USERCATALOG -----------0  
           TAPELIBRARY -----------0  
           TAPEVOLUME ------------0  
           TOTAL ----------------17  

·        This can be used to determine if a file already exists .
LISTCAT GDG ALL LEVEL(SM017R.TEST)                      
Above will be used to list all info about all the GDG that start with Sm017r.TEST.

·        If there is no entry with the name we provide step the LISTCAT operation ends with CC 0004 and we can use this CC to determine the course of action using IF…LASTCC.

1 comment: