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

Listing all those GDG bases with no generations


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

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Fri May 15, 2009 1:20 pm
Reply with quote

Hi,

I want to list out all the GDG bases that are having no generations in the catalogue of my LPAR.

List should exclude all the GDG bases and their generations, if the GDG has at lease one generation. I want to check all the GDGs that are currently on disk as well as migrated.

Please help me.

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

Global Moderator


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

PostPosted: Fri May 15, 2009 1:21 pm
Reply with quote

What help do you need. You have the logic - all you need is the code.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri May 15, 2009 2:06 pm
Reply with quote

OK, so I'm in a really good mood today. Here's some REXX code to get all of the GDG base names and associated GDS datasets.

Beware the pitfalls of shared catalogs between LPARs !!!

Code:

/* REXX **                                                        */
 "EXECIO * DISKR CATIN ( STEM CAT. FINIS"
 DO KCNT = 1 TO CAT.0
 KEY = SUBSTR(CAT.KCNT,1,44)
MODRSNRC = SUBSTR(' ',1,4)
CSIFILTK = SUBSTR(KEY,1,44)
CSICATNM = SUBSTR(' ',1,44)
CSIRESNM = SUBSTR(' ',1,44)
CSIDTYPS = 'BH              '
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
     SAY  COPIES(' ',8) DTYPE DNAME VOLSER.1
     DNAMET=DNAME
    END
    POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))
  END
END
END
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon May 25, 2009 7:29 pm
Reply with quote

Thanks much.

I am not very comfortable with Rexx. Is there any JCL utilities for this similar to LISTCAT.

And also i am looking for only GDG base names only.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon May 25, 2009 7:50 pm
Reply with quote

Here's the JCL to execute the REXX code given earlier.

Put the code into a PDS. Change the JCL below to reflect the member name chosen and the PDS name used, submit it, and Robert is your fathers brother.

The ** can be replaced with any valid combination of * ** % or %% IBM filtering characters,
e.g. ABC.*.DEF.H%%%X

The ouput isn't going to be exactly but I'm sure you will find some way of getting the exact results you want from the output
Code:

//STEP0020 EXEC PGM=IKJEFT01,PARM='Member'   
//SYSEXEC  DD DSN=Your REXX Library,DISP=SHR 
//SYSOUT   DD SYSOUT=*                       
//SYSTSPRT DD SYSOUT=*                       
//SYSTSIN  DD DUMMY                           
//CATIN    DD *                               
**                                       
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Mon May 25, 2009 7:53 pm
Reply with quote

Quote:
and Robert is your fathers brother.
So, you know my nieces and nephews? icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu May 28, 2009 12:02 pm
Reply with quote

Robert Sample wrote:
Quote:
and Robert is your fathers brother.
So, you know my nieces and nephews? icon_biggrin.gif

Only the nieces icon_lol.gif
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 10:38 am
Reply with quote

I was able to run REXX from JCL.

But my problem is that this program needs to look at all catalogues. The above one expecting Catlogue names in instream.

I need it to take automatically all catologues.
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 11:23 am
Reply with quote

Also the progrma is not accepting the catologue i have given:

Below is error message:


IRX0553E The input or output file CATIN must be allocated to a sequential data
set, or single member of a partitioned data set.
IRX0670E EXECIO error while trying to GET or PUT a record.
*** [/code]
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jun 15, 2009 1:53 pm
Reply with quote

I guess that REXX isn't one of your strong points. The default of this EXEC is to process ALL catalogs. You do not need to specify catalog names, only dataset names in the CATIN DD * statement. You can use full * ** % %% filtering for this.

You need to include the following in the JCL
Code:

//CATIN    DD *
**
/*


I would hazard a guess that you are using IRXJCL to execute this REXX. Although it may work for this instance, I would recommend that you use PGM=IKJEFT01 as a matter of course as this allows much more functionality.
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 3:48 pm
Reply with quote

Thank you very much for your quick help.

Yes, I am familiar with only Basics of REXX. I was able to correct the two errors in the program ( NOT equal symbols).

So, Can i use a pattern of the datsets that i need to extract, in CATIN instream?

I need to get the following GDG bases and corresponding generation:

USERID.A.GDG.TESTGDG
USERID.A.TESTGDG
USERID.A.TESTGDG.G0001V00

Can i give USERID.A.* in CATIN to retrieve al the above?

I am using IKJEFT01 only.

Also pls let me know where should I assign the output file for the list. I think it is currently routed to sysout. I do not observe any DISKW statements.
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 3:59 pm
Reply with quote

As suggested by you, I have given ** in CATIN.

Program has extracted all the GDG bases and corresponding generations (GDG , GDS) in a clean formatted way.

The only thing I wanted now is to extact the similar way for a pattern that I can give.

Looking forward for your help. Meanwhile I will try to figure it out.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jun 15, 2009 4:04 pm
Reply with quote

You can use the same filtering criteria as you do for when you use 3.4
Back to top
View user's profile Send private message
sampatir

New User


Joined: 12 May 2009
Posts: 13
Location: India

PostPosted: Mon Jun 15, 2009 4:18 pm
Reply with quote

Yes.

I have used USERID.A.** in CATIN and it worked perfectly.

Thank you so much for your help. I am started analyzing the program.

I have written one other REXX program to strip the generation portion of the GDG by going through some of the posts in forum.

Thanks again
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 Rexx to list generations of GDGs and ... CLIST & REXX 3
No new posts how to show listing in physical locat... PL/I & Assembler 2
No new posts Listing EVERY Dataset on a system All Other Mainframe Topics 4
No new posts listing sum if zero DFSORT/ICETOOL 4
No new posts Compare each GDG Generations to other... JCL & VSAM 13
Search our Forums:

Back to Top