View previous topic :: :: View next topic
Author
Message
Pons New User Joined: 25 May 2007Posts: 61 Location: Coimbatore
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
superk Moderator Team Head Joined: 26 Apr 2004Posts: 4650 Location: Raleigh, NC, USA
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8657 Location: Back in jolly old England
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
Pons New User Joined: 25 May 2007Posts: 61 Location: Coimbatore
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
expat Global Moderator Joined: 14 Mar 2007Posts: 8657 Location: Back in jolly old England
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
Pons New User Joined: 25 May 2007Posts: 61 Location: Coimbatore
I dont need from the batch and all.. Even terminal result is enough for me... Can you pls help for that....
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8657 Location: Back in jolly old England
What have YOU tried so far with the code that I had posted.
Back to top
Please enable JavaScript!