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

How to find the given DS is GDG or not using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Mon Aug 10, 2009 2:40 pm
Reply with quote

I just want to know the given dataset is GDG or Not.

I tried with SYSDSN and LISTDSI. Both are not working....

I gave the base GDG and tried with all the above options... Pls help me...

I'm devoloping a tool which will give the type of dataset.. If I give the GDG Base it should give the result as GDG....


Thanks.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 10, 2009 2:49 pm
Reply with quote

Use the LISTCAT TSO/E Command.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Aug 10, 2009 3:26 pm
Reply with quote

Take a look at THIS thread. It should be easy enough to adapt the code to run from a terminal instead of in batch.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Tue Aug 11, 2009 12:45 pm
Reply with quote

Hi Expat,

I got the below details form the given link. But i am not clear about this things. Can you please just give the code only which will tell the given dataset type...

Suppose if i give PDS dataset; it should tell PDS or
If i give GDG base it should tell GDG.

Can you please help me here....

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
expat

Global Moderator


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

PostPosted: Tue Aug 11, 2009 1:10 pm
Reply with quote

Quote:
Can you please just give the code only which will tell the given dataset type...

As I said in my previous post - it should be easy enough for you to adapt to run from a terminal instead of batch, so it should be easy enough for you to add a little functionality to get the DSORG info as well.

It is requests like this, where 99% of the code is given away and then people ask me to amend MY code for THEIR requirement without any visible effort of their own that makes me want to not bother posting any more code in the future.

Now go away and play with what you have been given and put some effort into it yourself.
Back to top
View user's profile Send private message
Pons

New User


Joined: 25 May 2007
Posts: 61
Location: Coimbatore

PostPosted: Tue Aug 11, 2009 1:55 pm
Reply with quote

I dont need from the batch and all.. Even terminal result is enough for me... Can you pls help for that....
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Aug 11, 2009 2:41 pm
Reply with quote

What have YOU tried so far with the code that I had posted.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top