Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Listing all those GDG bases with no generations

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Listing all those GDG bases with no generations
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: 8593
Location: Back in jolly old England

PostPosted: Fri May 15, 2009 1:21 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri May 15, 2009 2:06 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon May 25, 2009 7:50 pm    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Mon May 25, 2009 7:53 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu May 28, 2009 12:02 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 15, 2009 1:53 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 15, 2009 4:04 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare each GDG Generations to other... Ayyappa1 JCL & VSAM 13 Tue Jun 28, 2016 1:48 pm
No new posts Parsing and Listing a Subset of Recor... Charles Wolters IBM Tools 3 Fri Feb 05, 2016 10:39 pm
No new posts Editing "member generations"... Ricardo Viegas TSO/ISPF 1 Tue Dec 29, 2015 7:27 pm
No new posts Rexx code that expands changeman comp... Gopalakrishnan V CLIST & REXX 0 Thu Jan 08, 2015 11:31 am
No new posts Read all GDG generations, execept las... knobi JCL & VSAM 5 Fri Dec 12, 2014 12:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us