View previous topic :: View next topic
|
Author |
Message |
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Can somebody assist in developing a tool or JCL to list out all the datasets present in one particular mainframe region? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
What does "one particular mainframe region" mean to you?
One way to list datasets is using LISTCAT. There are multiple examples in the forum. |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
My requirement is to list the DSN's of the particular region.For example we have divided LPAR's as development region and Production region, now we just want to list all the DSN's used in any of the region i.e Dev or Prod.
I believe LISTCAT will list out all the details for the particular dataset name provided and which is not what i asked for.
Thank you Dick for the reply.. |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Hi Himanshu Sharma,
Do you have only one id for that region because if you have multiple ids(users) then i hope you cannot list all the datasets on a single shot. |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi Anand,
Yes we do have multiple user's(Ids).
I think there is the way to list out all the DSN by their HLQ's for the region. |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
If you find that please let me know by the way what is HLQ's (send PM) |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
HLQ's ----> High level qualifier.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
SYS1.SAMPLIB(IGGCSIRX) will do the trick.
Anuj D posted a good example of using it in the forum a while ago.
What about shared HLQ's between the two LPARs ? |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi
Where can i find this? SYS1.SAMPLIB(IGGCSIRX) |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Errmmmmmmmmmm it's a PDS |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
Quote: |
Can somebody assist in developing a tool or JCL to list out all the datasets present in one particular mainframe region? |
Please let us know, what approach did you think so far? Approach would change shop to shop so asking this becaomes relevant. . . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Assuming that the member is in the PDS shipped by IBM, and that you have READ access this should do it
Code: |
//STEP0020 EXEC PGM=IKJEFT01
//SYSEXEC DD DSN=SYS1.SAMPLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%IGGCSIRX
**
|
|
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Hi,
We donot have access to SYS1.SAMMPLIB,Need to find out another way to resolve.
Anuj,
The requirement is to list out all the files in the region and then delete the files which are not as per the clients standards. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Ask a sysprog to copy the member for you, or someone who has access to the files.
If you have a legitimate reason for using the file, then ask for it. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
himanshu7 wrote: |
The requirement is to list out all the files in the region and then delete the files which are not as per the clients standards. |
fine but this does not answer
Quote: |
Please let us know, what approach did you think so far? |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
You keep using the term "region" -- terminology can be critical so it is important to be accurate. It sounds like you're referring to an LPAR -- but you could be talking about a catalog as well. Usually on a mainframe the term "region" refers to a CICS address space, not an LPAR.
If you don't have access to SYS1.SAMPLIB, can you contact your systems support group and get access? Most of the tools to generate lists of data sets require some sort of system-level access which it sounds like you may not have; your task is much more difficult in this case.
I also have a concern about your statement
Quote: |
then delete the files which are not as per the clients standards. |
Does this mean you're going to delete system data sets as well? Granted that proper security will prevent you from doing so, but if you manage to delete SYS1.PARMLIB your next IPL of the LPAR will be real exciting (and I do not mean that in a good way). |
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Requirement is to clean up the non-standard files from test and that means the dataset could be on different LPAR's.
Well i have created REXX tool which is extracting the files with their HLQ's in the output dataset.
But the problem is time consumption. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
The code for CSI is as follows. It should be much faster than your own code, and uses all of the standard wildcard combinations.
JCL
Code: |
//STEP0020 EXEC PGM=IKJEFT01,PARM='IGGCSIRX'
//SYSEXEC DD DSN=Your REXX Library,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//CATIN DD *
**
/*
|
The REXX code
Code: |
/* REXX ** INVOKE CSI VIA BATCH REXX PROCESS */
"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 = SUBSTR(' ',1,16)
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
SAY 'CATALOG ' CATNAME
SAY ' '
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
LISTVOL1 = VOLSER.1 ||" "|| VOLSER.2 ||" "|| VOLSER.3
LISTVOL2 = VOLSER.4 ||" "|| VOLSER.5 ||" "|| VOLSER.6
LISTVOL3 = VOLSER.7 ||" "|| VOLSER.8 ||" "|| VOLSER.9
SAY COPIES(' ',8) DTYPE DNAME LISTVOL1 LISTVOL2 LISTVOL3
DNAMET=DNAME
END
POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))
END
END
END
|
|
|
Back to top |
|
|
himanshu7
Active User
Joined: 28 Aug 2007 Posts: 131 Location: At Desk
|
|
|
|
Thank you Expat.. |
|
Back to top |
|
|
|