//#TSMSZ1T JOB (SYS,9999),'MARK ZELDEN', // NOTIFY=&SYSUID, // CLASS=J,MSGCLASS=T,MSGLEVEL=(1,1) //* //VTOC EXEC PGM=IKJEFT01,REGION=2M //STEPLIB DD DISP=SHR,DSN=#TSMSZ1.LOADLIB /* VTOC COMMAND */ //SYSTSPRT DD DSN=&&TEMP,DISP=(NEW,PASS,DELETE), // UNIT=SYSALLDA,SPACE=(CYL,(5,5),RLSE), // DCB=(LRECL=133,BLKSIZE=0,RECFM=FB) //* //* VTOC IS FROM CBT FILE 112 - http://www.cbttape.org //* VTOC COMMAND SYNTAX TO USE: //* VTOC volmask SORT (use volmask of "ALL" for all volumes) //* //SYSTSIN DD * VTOC ALL SORT /* //* //GENEXEC EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSUT2 DD DSN=&&PDS(VTOCTOT),DISP=(NEW,PASS,DELETE), // UNIT=SYSALLDA,SPACE=(TRK,(1,1,1)), // DCB=(LRECL=80,BLKSIZE=3120,RECFM=FB) //SYSIN DD DUMMY //SYSUT1 DD DATA,DLM=## /* REXX */ /* */ /* AUTHOR: Mark Zelden */ /* */ /* Process VTOC command output and */ /* total allocations by HLQ. */ /* */ /*****************************************/ /* VTOC COMMAND SYNTAX EXPECTED: */ /* VTOC ALL SORT */ /* or */ /* VTOC volmask SORT */ /*****************************************/ /* allocate input file */ /*****************************************/ /* "ALLOC FI(INPUT) DA('userid.VTOC.OUTPUT') SHR REUSE" */ /*****************************************/ /* read input file into stem variables */ /*****************************************/ "EXECIO * DISKR INPUT (STEM INREC. FINIS" /* "FREE FI(INPUT)" */ /******************************************/ j = 0 /* total # of dsns */ tothlq = 0 /* total alloc by hlq */ tothdsn = 0 /* total # of hlq dsns */ totalloc = 0 /* total alloc all dsns */ numhlq = 0 /* total # unique hlqs */ oldhlq = '????????' /* init oldhlq */ /******************************************/ Do i = 1 to inrec.0 chkalc = Substr(inrec.i,3,5) If Datatype(chkalc,Number) <> 1 then iterate /* record not needed */ j = j + 1 /* add 1 to tot # of dsns */ dsn.j = Substr(inrec.i,63,44) /* extract dsn from ip rec */ /* vol.j = Substr(inrec.i,56,44) */ /* extract vol from ip rec */ alloc.j = chkalc /* total tracks allocated for this dsn */ dotpos = Pos('.',dsn.j) /* find where the hlq ends */ If dotpos = 0 then curhlq = Strip(dsn.j) /* sinqle node data set */ Else curhlq = Substr(dsn.j,1,dotpos-1) /* extract hlq from dsn */ If curhlq <> oldhlq & j <> 1 then call TOTAL_HLQ /*total this hlq */ oldhlq = curhlq /* reset oldhlq to current hlq */ tothlq = tothlq + alloc.j /* add to current total by hlq */ tothdsn = tothdsn + 1 /* add 1 to tot # of dsns by hlq */ End /* do */ /******************************************/ /* write total and exit */ /******************************************/ call TOTAL_HLQ /* total current/last hlq */ Say ' ' Say totalloc 'Total tracks allocated ' , Format((totalloc/15),,0) 'Total cylinders allocated ', j 'Total data sets ' numhlq 'Total HLQs' Exit 0 TOTAL_HLQ: /* totals for current hlq */ Say Right(oldhlq,8,' ') '-', Right(tothlq,8,' ') 'Tracks allocated ' , Right(Format((tothlq/15),,0),7,' ') 'Cylinders allocated ' , Right(tothdsn,7,' ') 'Data sets' totalloc = totalloc + tothlq /* add to total for all data sets */ numhlq = numhlq + 1 /* add 1 to total # of hlqs */ tothlq = 0 /* reset tot alloc by hlq */ tothdsn = 0 /* reset tot # dsns by hlq */ Return ## //PROCESS EXEC PGM=IRXJCL,PARM='VTOCTOT' //SYSTSIN DD DUMMY //SYSTSPRT DD SYSOUT=* //SYSEXEC DD DSN=&&PDS,DISP=(OLD,DELETE) //INPUT DD DSN=&&TEMP,DISP=(OLD,DELETE)