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

How to list the datasets in a particular region?


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

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 10:28 am
Reply with quote

Can somebody assist in developing a tool or JCL to list out all the datasets present in one particular mainframe region?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Thu Mar 12, 2009 10:39 am
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 10:59 am
Reply with quote

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
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Mar 12, 2009 11:24 am
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 11:29 am
Reply with quote

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
View user's profile Send private message
anandinmainframe

Active User


Joined: 31 May 2007
Posts: 171
Location: India

PostPosted: Thu Mar 12, 2009 11:34 am
Reply with quote

If you find that please let me know by the way what is HLQ's (send PM)
Back to top
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 11:59 am
Reply with quote

Hi,

HLQ's ----> High level qualifier..
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Mar 12, 2009 12:23 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 1:30 pm
Reply with quote

Hi

Where can i find this? SYS1.SAMPLIB(IGGCSIRX)
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Mar 12, 2009 2:31 pm
Reply with quote

Errmmmmmmmmmm it's a PDS
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Mar 12, 2009 3:16 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Mar 12, 2009 3:52 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Thu Mar 12, 2009 5:06 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Mar 12, 2009 5:21 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Mar 12, 2009 5:21 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Mar 12, 2009 5:28 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Mar 13, 2009 12:45 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Fri Mar 13, 2009 1:00 pm
Reply with quote

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
View user's profile Send private message
himanshu7

Active User


Joined: 28 Aug 2007
Posts: 131
Location: At Desk

PostPosted: Fri Mar 13, 2009 1:26 pm
Reply with quote

Thank you Expat.. 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 How to Login in to cics region and is... CICS 9
No new posts JES datasets IO Error ABENDS & Debugging 3
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top