View previous topic :: View next topic
|
Author |
Message |
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
What help do you need. You have the logic - all you need is the code. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
and Robert is your fathers brother. |
So, you know my nieces and nephews? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Robert Sample wrote: |
Quote: |
and Robert is your fathers brother. |
So, you know my nieces and nephews? |
Only the nieces |
|
Back to top |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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
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 |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You can use the same filtering criteria as you do for when you use 3.4 |
|
Back to top |
|
|
sampatir
New User
Joined: 12 May 2009 Posts: 13 Location: India
|
|
|
|
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 |
|
|
|