Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
Posted: Tue Jan 31, 2012 10:27 am Post subject: All cataloged datasets on Tape
Does anyone know how to get a list of all the datasets that are cataloged and are on tape? Adrdssu does not offer the option to look for a volume serial no. Perhaps sort could do this?
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Wed Feb 01, 2012 4:01 am Post subject:
Your tape management software may be able to help, but for a straight search of the catalogs I would suggest SYS1.SAMPLIB(IGGCSIRX). The basic REXX returns the dataset name and volser, so with a bit of minimal REXX coding can get what I believe you want. _________________ If it's true that we are here to help others,
then what exactly are the others here for ?
Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
Posted: Thu Feb 02, 2012 2:28 am Post subject:
Thanks a lot for your answer. Your suggestion sounds very interesting and I will definitely examine that. The problem is that we have data sets that are cataloged and valid, but due to an error in the tape management parameters (changed tape management systems) these new data sets have been overwritten by even newer data sets - in other words the tapes became scratch even though they should not have. My boss already wrote a rexx to process all the user catalogs, but this examines the idcams output, that IGGCSIRX sounds even better. Thanks.
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
Posted: Thu Feb 02, 2012 3:44 am Post subject:
The code below might save you or boss reinventing the wheel. It's something I wrote about 12 years ago for storage management tasks.
Does require DFSORT to be installed........................................
The INCLUDES and EXCLUDES support full use of * ** and % name masking.
Just stick the REXX code into SYSEXEC as a member CSIUTIL and off you go. Hopefully the options are clear from the stuff written in the JCL, but for your case
Code:
PARM='CSIUTIL SCAN TAPE'
Should give you what you need.
If you need any more info, feel free to ask.
Code:
//XXCSUTIL JOB 'JOB INFORMATION',
// CLASS=M,
// MSGCLASS=T,
// NOTIFY=&SYSUID
//*
//*--------------------------------------------------------------------
//STEP0020 EXEC PGM=IKJEFT01,DYNAMNBR=256,
// PARM='CSIUTIL SCAN TAPE DASD MIGR GDG'
//*--------------------------------------------------------------------
//* INCLUDES DD USE ==DATASET PATTERN TO OVERRIDE EXCLUDES
//*--------------------------------------------------------------------
//INCLUDES DD *
XX.**.TXT
/*
//EXCLUDES DD *
/*
//*********************************************************************
//* PARM VALUES - SCAN - LIST DATASETS ONLY
//* - RUN - DELETE OR HSM REQUEST FOR DATASETS
//*********************************************************************
//** FOR LIST / DELETE OF DATASETS - USE ANY COMBINATION OF OPTIONS
//**-----------------------------------------------------------------**
//* SCAN / RUN - DASD - LIST / DELETE DASD DATASETS
//* - MIGR - LIST / DELETE MIGRATED DATASETS
//* - TAPE - LIST / DELETE TAPE DATASETS
//* NOT WITH GDGF - GDG - LIST / DELETE EMPTY GDG BASE
//* NOT WITH GDG - GDGF - LIST / DELETE GDS DATASETS AND GDG BASE
//**-----------------------------------------------------------------**
//* MIGR - USE ML1 OR ML2 TO LIMIT MIGRAT LEVEL IF REQUIRED
//*********************************************************************
//** FOR HSM PROCESSING - USE ONLY 1 OPTION (EXCEPT BACKDSD BACKMG1)
//**-----------------------------------------------------------------**
//* SCAN / RUN - RECALL - RECALL SELECTED DATASETS
//* - ARCH - MIGRATE SELECTED DATASETS TO MGMT DEFAULT
//* - ARCH2 - MIGRATE SELECTED DATASETS TO ML2
//* - M1M2 - MIGRATE FROM ML1 TO ML2
//* - BACKDSD - PERFORM HSM BACKUP ON DASD DATASETS
//* - BACKMG1 - PERFORM HSM BACKUP ON ML1 DATASETS
//**-----------------------------------------------------------------**
//* RECALL ONLY - USE ML1 OR ML2 TO LIMIT MIGRAT LEVEL IF REQUIRED
//*********************************************************************
//SYSEXEC DD DSN=XX.REXX,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//EXCLUDE DD SYSOUT=*
//REPORT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//TEMPWK1 DD DISP=(MOD,PASS,DELETE),
// SPACE=(CYL,(50,50)),
// RECFM=FB,LRECL=100
//TEMPWK2 DD DISP=(MOD,PASS,DELETE),
// SPACE=(CYL,(50,50)),
// RECFM=FB,LRECL=100
//TEMPWK3 DD DISP=(MOD,PASS,DELETE),
// SPACE=(CYL,(50,50)),
// RECFM=FB,LRECL=100
Code:
/* REXX *** BATCH LIST / DELETE / HSM ACTION FOR SELECTED DATASETS */
SIGNAL ON SYNTAX NAME ERR
CARD = COPIES(' ',80)
ARG RUN OPTS
IF RUN <> "RUN"
THEN RUN = "SCAN"
IF OPTS = ""
THEN OPTS = "DASD TAPE MIGR"
BACKDSD = ' '
BACKMG1 = ' '
HSM = 0
IF POS('MIGR',OPTS) > 0 THEN HSM = HSM + 1
IF POS('ARCH ',OPTS) > 0 THEN HSM = HSM + 1
IF POS('ARCH2',OPTS) > 0 THEN HSM = HSM + 1
IF POS('M1M2',OPTS) > 0 THEN HSM = HSM + 1
IF POS('RECALL',OPTS) > 0 THEN HSM = HSM + 1
IF POS('BACKDSD',OPTS) > 0 THEN DO
BACKDSD = 'Y'
IF BACKMG1 = 'Y' THEN DO
END
ELSE DO
HSM = HSM + 1
END
END
IF POS('BACKMG1',OPTS) > 0 THEN DO
BACKMG1 = 'Y'
IF BACKDSD = 'Y' THEN DO
END
ELSE DO
HSM = HSM + 1
END
END
IF HSM > 1 THEN DO
SAY "ONLY ONE HSM REQUEST CAN BE PROCESSED IN THE JOB "
SAY "PARMS = "OPTS
EXIT 4
END
GDGX = ''
GDGZ = 0
IF POS('GDG ',OPTS) > 0 & POS('GDGF',OPTS) > 0 THEN DO
SAY "ONLY ONE GDG PARAMETER MAY BE SPECIFIED"
SAY "PARMS = "OPTS
EXIT 4
END
IF POS('GDG ',OPTS) > 0
THEN GDGX = 'GDG'
IF POS('GDGF',OPTS) > 0
THEN GDGX = 'GDGF'
MIGONLY = " "
IF POS("ML1",OPTS) > 0
THEN MIGONLY = "ML1"
IF POS("ML2",OPTS) <> 0 & MIGONLY <> " " THEN DO
SAY "ONLY ONE MIGRATION LEVEL MAY BE SPECIFIED"
SAY "PARMS = "OPTS
EXIT 4
END
ELSE DO
IF POS("ML2",OPTS) <> 0
THEN MIGONLY = "ML2"
END
IF POS(MIGONLY,OPTS) > 0 THEN DO
OPTS = OVERLAY(" ",OPTS,POS(MIGONLY,OPTS))
END
DO A = 1 TO WORDS(OPTS)
IF A = 1
THEN CARDO = OVERLAY(' INCLUDE COND=(',CARD,1)
ELSE CARDO = CARD
IF A = WORDS(OPTS)
THEN ENDIT = ")"
ELSE ENDIT = ",OR,"
IF WORD(OPTS,A) = "MIGR" THEN DO
IF MIGONLY = " " THEN DO
CARDX = "46,4,CH,EQ,C'MIGR'"||ENDIT
END
ELSE DO
CARDX = "(46,4,CH,EQ,C'MIGR',AND,52,3,CH,EQ,C'"MIGONLY"')" ,
||ENDIT
END
END
ELSE IF WORD(OPTS,A) = "GDG" | WORD(OPTS,A) = "GDGF" THEN DO
CARDX = "46,4,CH,EQ,C'GDG '"||ENDIT
END
ELSE IF WORD(OPTS,A) = "BACKDSD" THEN DO
CARDX = "46,4,CH,EQ,C'DASD'"||ENDIT
END
ELSE IF WORD(OPTS,A) = "ARCH" THEN DO
CARDX = "46,4,CH,EQ,C'DASD'"||ENDIT
END
ELSE IF WORD(OPTS,A) = "ARCH2" THEN DO
CARDX = "46,4,CH,EQ,C'DASD'"||ENDIT
END
ELSE IF WORD(OPTS,A) = "BACKMG1" THEN DO
CARDX = "(46,4,CH,EQ,C'MIGR',AND,52,3,CH,EQ,C'ML1')"||ENDIT
END
ELSE IF WORD(OPTS,A) = "M1M2" THEN DO
CARDX = "(46,4,CH,EQ,C'MIGR',AND,52,3,CH,EQ,C'ML1')"||ENDIT
END
ELSE IF WORD(OPTS,A) = "RECALL" THEN DO
IF MIGONLY = " "
THEN CARDX = "46,4,CH,EQ,C'MIGR'"||ENDIT
ELSE CARDX = "46,4,CH,EQ,C'MIGR',AND,52,3,CH,EQ,C'"MIGONLY"'" ,
||ENDIT
END
ELSE CARDX = "46,4,CH,EQ,C'"WORD(OPTS,A)"'"||ENDIT
CARDO = OVERLAY(CARDX,CARDO,16)
SRTOUT.A = CARDO
SRTOUT.0 = A
END
CTEMP01 = 0
CTEMP02 = 0
CTEMP03 = 0
"ALLOC FI(TEMP01) NEW CYLINDERS SPACE(50 50) RECFM(F B) LRECL(100)"
"ALLOC FI(TEMP02) NEW CYLINDERS SPACE(50 50) RECFM(F B) LRECL(100)"
"ALLOC FI(TEMP03) NEW CYLINDERS SPACE(50 50) RECFM(F B) LRECL(100)"
"ALLOC FI(TEMP04) NEW CYLINDERS SPACE(50 50) RECFM(F B) LRECL(100)"
"ALLOC FI(TEMP05) NEW CYLINDERS SPACE(50 50) RECFM(F B) LRECL(100)"
"EXECIO * DISKR INCLUDES ( STEM CAT. FINIS"
DO KCNT = 1 TO CAT.0
IF SUBSTR(CAT.KCNT,1,2) = "==" THEN DO
KEY = SUBSTR(CAT.KCNT,3,44)
DDNAME = "TEMP03"
END
ELSE DO
KEY = SUBSTR(CAT.KCNT,1,44)
DDNAME = "TEMP01"
END
CALL CSIUTIL(KEY DDNAME)
END
"EXECIO 0 DISKW TEMP01 ( FINIS"
"EXECIO 0 DISKW TEMP03 ( FINIS"
CAT.0 = 0
DROP CAT.
"EXECIO * DISKR EXCLUDES ( STEM CAT. FINIS"
DDNAME = "TEMP02"
DO KCNT = 1 TO CAT.0
KEY = SUBSTR(CAT.KCNT,1,44)
CALL CSIUTIL(KEY DDNAME)
END
"EXECIO 0 DISKW TEMP02 ( FINIS"
IF CTEMP01 > 0 | CTEMP03 > 0 THEN DO
"ALLOC FI(TOOLIN) RECFM(F B) LRECL(80) TRACKS SPACE(5 5)"
QUEUE " COPY FROM(TEMP01) TO(TEMPWK1) USING(CTL1)"
QUEUE " COPY FROM(TEMP02) TO(TEMPWK1) USING(CTL2)"
QUEUE " SELECT FROM(TEMPWK1) TO(TEMPWK2) ON(1,44,CH) NODUPS"
QUEUE " COPY FROM(TEMP03) TO(TEMPWK2) USING(CTL1)"
QUEUE " COPY FROM(TEMPWK2) TO(TEMP05) USING(CTL3)"
QUEUE " COPY FROM(TEMP02) TO(TEMPWK3) USING(CTL2)"
QUEUE " COPY FROM(TEMP03) TO(TEMPWK3) USING(CTL1)"
QUEUE " SELECT FROM(TEMPWK3) TO(TEMP04) ON(1,44,CH) NODUPS"
QUEUE " COPY FROM(TEMP04) TO(EXCLUDE) USING(CTL4)"
"EXECIO" QUEUED() "DISKW TOOLIN ( FINIS"
"ALLOC FI(CTL1CNTL) RECFM(F B) LRECL(80) TRACKS SPACE(5 5)"
QUEUE " SORT FIELDS=(1,44,CH,A)"
QUEUE " SUM FIELDS=NONE"
QUEUE " INREC BUILD=(1,99,C'1')"
IF SRTOUT.0 > 0 THEN DO
DO A = 1 TO SRTOUT.0
QUEUE SRTOUT.A
END
END
"EXECIO" QUEUED() "DISKW CTL1CNTL ( FINIS"
"ALLOC FI(CTL2CNTL) RECFM(F B) LRECL(80) TRACKS SPACE(5 5)"
QUEUE " SORT FIELDS=(1,44,CH,A)"
QUEUE " SUM FIELDS=NONE"
QUEUE " INREC BUILD=(1,100)"
IF SRTOUT.0 > 0 THEN DO
DO A = 1 TO SRTOUT.0
QUEUE SRTOUT.A
END
END
"EXECIO" QUEUED() "DISKW CTL2CNTL ( FINIS"
"ALLOC FI(CTL3CNTL) RECFM(F B) LRECL(80) TRACKS SPACE(5 5)"
QUEUE " SORT FIELDS=(1,44,CH,A)"
QUEUE " INCLUDE COND=(100,1,CH,EQ,C'1')"
"EXECIO" QUEUED() "DISKW CTL3CNTL ( FINIS"
"ALLOC FI(CTL4CNTL) RECFM(F B) LRECL(80) TRACKS SPACE(5 5)"
QUEUE " SORT FIELDS=(1,44,CH,A)"
QUEUE " INCLUDE COND=(100,1,CH,NE,C'1')"
"EXECIO" QUEUED() "DISKW CTL4CNTL ( FINIS"
"CALL *(ICETOOL)"
END
ELSE EXIT
"EXECIO * DISKR TEMP05 ( STEM DSNS. FINIS"
DO A = 1 TO DSNS.0
PARSE VAR DSNS.A 1 DSNAME 45 . ,
46 DEVICE 50 . ,
52 MIGLEV 55 . ,
56 VOLUMES 77 .
IF MIGONLY <> " " & MIGLEV <> " "
THEN IF MIGLEV <> MIGONLY
THEN ITERATE
IF POS('DASD',OPTS) > 0 & DEVICE = "DASD" & MIGLEV = " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " DELETE '"STRIP(DSNAME)"'"
END
IF POS('TAPE',OPTS) > 0 & DEVICE = "TAPE" & MIGLEV = " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " DELETE '"STRIP(DSNAME)"'"
END
IF POS('MIGR',OPTS) > 0 & MIGLEV <> " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " DELETE '"STRIP(DSNAME)"'"
END
IF POS('GDG',OPTS) > 0 & DEVICE = 'GDG ' THEN DO
PUSH DSNAME DEVICE
"EXECIO 1 DISKW REPORT"
GDGZ = GDGZ + 1
GDGS.GDGZ = DSNAME
END
IF POS('RECALL',OPTS) > 0 & MIGLEV <> " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HRECALL '"STRIP(DSNAME)"'"
END
IF POS('ARCH ',OPTS) > 0 & MIGLEV = " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HMIG '"STRIP(DSNAME)"'"
END
IF POS('ARCH2',OPTS) > 0 & MIGLEV = " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HMIG '"STRIP(DSNAME)"' ML2"
END
IF POS('M1M2',OPTS) > 0 & MIGLEV = "ML1" THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HMIG '"STRIP(DSNAME)"' ML2"
END
IF POS('BACKDSD',OPTS) > 0 & MIGLEV = " " THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HBACKDS '"STRIP(DSNAME)"'"
END
IF POS('BACKMG1',OPTS) > 0 & MIGLEV = "ML1" THEN DO
PUSH DSNAME DEVICE MIGLEV VOLUMES
"EXECIO 1 DISKW REPORT"
IF RUN = "RUN"
THEN " HBACKDS '"STRIP(DSNAME)"'"
END
END
IF GDGZ > 0 THEN DO
DO A = 1 TO GDGZ
X = OUTTRAP('GDGO.')
" LISTCAT ENT('"STRIP(GDGS.A)"')"
X = OUTTRAP(OFF)
DO AA = 1 TO GDGO.0
PARSE VAR GDGO.AA G1 G2 G3
IF G1 = "NONVSAM" THEN DO
IF GDGX = "GDGF" THEN DO
IF RUN = "RUN"
THEN " DELETE '"STRIP(G3)"'"
END
ELSE DO
SAY "GDG BASE "STRIP(GDGS.A)" IS NOT EMPTY"
ITERATE A
END
END
END
IF RUN = "RUN"
THEN " DELETE '"STRIP(GDGS.A)"'"
END
END
EXIT
/*-------------------------------------------------------------------*/
CSIUTIL:
ARG KEY DDNAME .
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 = '0002'X
CSIFLD1 = 'VOLSER '
CSIFLD2 = 'DEVTYP '
CSIOPTS = CSICLDI || CSIRESUM || CSIS1CAT || CSIRESRV
CSIFIELD = CSIFILTK || CSICATNM || CSIRESNM || CSIDTYPS || CSIOPTS
CSIFIELD = CSIFIELD || CSINUMEN || CSIFLD1 || CSIFLD2
WORKLEN = 4096
DWORK = '00001000'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)
PROC = 1
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 = ' '
IF DTYPE = 'ALIAS ' | DTYPE = 'INDEX ' | ,
DTYPE = 'DATA ' | DTYPE = 'PATH ' | DTYPE = ' '
THEN PROC = 0
NUMVOL = 0
POS1 = POS1 + 46
NUMVOL = C2D(SUBSTR(DWORK,POS1+4,2))/6
POS2 = POS1+8
VOLSER = ""
DO I = 1 TO NUMVOL
VOLSER = STRIP(VOLSER||" "||SUBSTR(DWORK,POS2,6))
POS2 = POS2 + 6
END
DEVTY1 = SUBSTR(DWORK,POS2,4)
DEVTY2 = C2X(SUBSTR(DWORK,POS2,4))
IF SUBSTR(DEVTY2,5,2) = '20' THEN DELDEV = 'DASD'
ELSE
IF SUBSTR(DEVTY2,5,2) = '80' THEN DELDEV = 'TAPE'
ELSE
DELDEV = 'XXXX'
IF DTYPE = 'CLUSTER' THEN DELDEV = 'DASD'
IF DTYPE = 'GDG '
THEN DELDEV = 'GDG '
IF DELDEV = 'DASD'
THEN MIGLEV = ' ML1'
ELSE MIGLEV = ' ML2'
IF LEFT(VOLSER,6) <> 'MIGRAT'
THEN MIGLEV = ' '
IF LEFT(VOLSER,6) = 'MIGRAT'
THEN DELDEV = 'MIGR'
IF DNAMET <> DNAME & PROC = 1 THEN DO
PUSH DNAME DELDEV MIGLEV VOLSER
"EXECIO 1 DISKW "DDNAME
INTERPRET "C"DDNAME" = C"DDNAME" + 1"
DNAMET=DNAME
END
POS1 = POS1 + C2D(SUBSTR(DWORK,POS1,2))
END
END
RETURN
/*-------------------------------------------------------------------*/
ERR:
SIGNAL OFF SYNTAX
DROPBUF
SAY "ERROR ROUTINE STARTING"
SAY " "
SAY RIGHT(SIGL,6) ">>>" SOURCELINE(SIGL)
SAY " "
TRACE I
INTERPRET SOURCELINE(SIGL)
_________________ If it's true that we are here to help others,
then what exactly are the others here for ?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum