IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find the total number of VSAM Files in a system ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Souparno

New User


Joined: 09 Sep 2008
Posts: 7
Location: India

PostPosted: Wed Sep 10, 2008 11:05 am
Reply with quote

Hi ,

Can you please help me figure out how to find the total number of VSAM files and preferably with their names present in a system. I would like to restrict to application VSAM files only (i.e. not underlying DB (DB2) VSAM files)

I understand all the entries should be there in the catalog entry files, but as an application developer I am not having access to browse the catalog file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Sep 10, 2008 11:32 am
Reply with quote

Take a look at SYS1.SAMPLIB (IGGCSIRX) which should be easily changeable to give you what you need.
Back to top
View user's profile Send private message
Souparno

New User


Joined: 09 Sep 2008
Posts: 7
Location: India

PostPosted: Thu Sep 11, 2008 11:37 am
Reply with quote

expat wrote:
Take a look at SYS1.SAMPLIB (IGGCSIRX) which should be easily changeable to give you what you need.


Hi ,

I tried to execute the REXX with some changes, but didnt get the required information. Moreover, currently there is no VSAM file which I have created (seems like I can get the details VSAM files created by me only).

To elaborate my question: Requirement is to know the total number of application VSAM files present in the system.

I know the catalog files of the VSAM files, but cant browse. Somehow if I can mention the catalog file as input and and get the total number of VSAM files inside the catalog might help me solve my problem.

Thanks..
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Sep 11, 2008 12:18 pm
Reply with quote

It works fine for me icon_lol.gif

Why do you need this information ? I do ask because having spent 30+ years in the industry, and a lot of them responsible for storage management, this is never something I have ever wanted to know or have ever been asked to provide.

JCL
Code:

//STEP0020 EXEC PGM=IKJEFT01,PARM='REXX name'
//SYSEXEC  DD DSN=REXX library,DISP=SHR         
//SYSOUT   DD SYSOUT=*                     
//SYSTSPRT DD SYSOUT=*                     
//SYSTSIN  DD DUMMY                         
//CATIN    DD *                             
catalog name goes here
and the next one is here
etc etc
/*                                         


REXX
Code:

/* REXX ** VSAM FROM A GIVEN CATALOG NAME                            */
"EXECIO * DISKR CATIN ( STEM CAT. FINIS"                             
DO KCNT = 1 TO CAT.0                                                 
MODRSNRC = SUBSTR(' ',1,4)                                             
CSIFILTK = LEFT('**',44)                                               
CSICATNM = LEFT(CAT.KCNT,44)                                           
CSIRESNM = SUBSTR(' ',1,44)                                           
CSIDTYPS = 'CRG             '                                         
CSICLDI  = SUBSTR('Y',1,1)                                             
CSIRESUM = SUBSTR(' ',1,1)                                             
CSIS1CAT = SUBSTR(' ',1,1)                                             
CSIRESRV = SUBSTR(' ',1,1)                                             
CSINUMEN = '0001'X                                                     
CSIFLD1  = 'VOLSER  '                                                 
CSIOPTS  = CSICLDI || CSIRESUM || CSIS1CAT || CSIRESRV                 
CSIFIELD = CSIFILTK || CSICATNM || CSIRESNM || CSIDTYPS || CSIOPTS     
CSIFIELD = CSIFIELD || CSINUMEN || CSIFLD1                             
WORKLEN = 65536                                                       
DWORK = '00010000'X || COPIES('00'X,WORKLEN-4)                         
RESUME = 'Y'                                         
CATNAMET = SUBSTR(' ',1,44)                           
DNAMET = SUBSTR(' ',1,44)                             
DO WHILE RESUME = 'Y'                                 
 ADDRESS LINKPGM 'IGGCSI00  MODRSNRC  CSIFIELD  DWORK'
 RESUME = SUBSTR(CSIFIELD,150,1)                     
 USEDLEN = C2D(SUBSTR(DWORK,9,4))                     
 POS1=15                                             
 DO WHILE POS1 < USEDLEN                             
   IF SUBSTR(DWORK,POS1+1,1) = '0'                   
    THEN DO                                           
         CATNAME=SUBSTR(DWORK,POS1+2,44)             
         IF CATNAME ^= CATNAMET THEN                 
          DO                                         
           CATNAMET = CATNAME                         
          END                                         
         POS1 = POS1 + 50                             
         END                                         
   DNAME = SUBSTR(DWORK,POS1+2,44)                   
   IF SUBSTR(DWORK,POS1+1,1) = 'C' THEN DTYPE = 'CLUSTER '     
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'D' THEN DTYPE = 'DATA    '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'I' THEN DTYPE = 'INDEX   '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'A' THEN DTYPE = 'NONVSAM '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'H' THEN DTYPE = 'GDS     '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'B' THEN DTYPE = 'GDG     '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'R' THEN DTYPE = 'PATH    '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'G' THEN DTYPE = 'AIX     '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'X' THEN DTYPE = 'ALIAS   '
   ELSE IF SUBSTR(DWORK,POS1+1,1) = 'U' THEN DTYPE = 'UCAT    '
   ELSE DTYPE = '        '                                     
    POS1 = POS1 + 46                                           
    NUMVOL = C2D(SUBSTR(DWORK,POS1+4,2))/6                     
    POS2 = POS1+6                                               
    VOLSER. = ""                                               
    DO I = 1 TO NUMVOL                                         
      VOLSER.I = SUBSTR(DWORK,POS2,6)                           
      POS2 = POS2 + 6                                           
    END                                                         
    IF DNAMET ^= DNAME THEN                         
    DO                                               
      IF LEFT(DNAME,9) <> 'SYS1.VVDS' THEN DO       
       SAY  SUBSTR(CATNAME,1,24) DTYPE DNAME VOLSER.1
      END                                           
     DNAMET=DNAME                                   
    END                                             
    POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))         
  END                                               
END                                                 
END                                                 
Back to top
View user's profile Send private message
Souparno

New User


Joined: 09 Sep 2008
Posts: 7
Location: India

PostPosted: Thu Sep 11, 2008 1:41 pm
Reply with quote

Hi ,

Thanks a ton for your help !

Its working.... !! Yesterday, I did not modify the REXX properly. Now I am getting the expected results.

As to your question:
I work as an Application Developer / Analyst. In the recent past I have got into a system (new to me) and need to get the details and estimate of application VSAM files present in the existing system for development and migration assignments. Thanks.. icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top