NOT a valid concern, NOT a normal practice ( whatever the world ), just a LOSS of time
but I had already imagined that, typical unix attitude, It takes time to search for it so I am going to rehinvent the wheel
hard to believe.. unless You are using a prehystoric operating system
are You serious...
even if You come from the unix world You should know about the basics of data representation...
what You define garbage is exactly the info You need to calculate the free space percentage in a volume...
and Yes I do know what I am talking about, the volume records are there, You just did not care to look for them
or ....
or if You really want to process the volume records from DCOLLECT here are a couple of snippets that might become handy
./ ADD NAME=DASDVOLS
/* REXX */
/* */
/* */
/* */
/* DASDVOLS */
/* PURPOSE: READS TYPE V AND C RECORDS FOR VOLUME DETAIL REPORT */
/* AND STORAGE GROUP SUMMARY REPORT, READS TYPE T RECORDS */
/* FOR DFHSM TAPE SUMMARY REPORT */
/* */
/* DETAIL REPORT BY VOLSER CONTAINS THE FOLLOWING: */
/* DATE DCOLLECT RUN */
/* DATE DFHSM DATA COLLECT */
/* VOLSER */
/* VOLUME CAPACITY IN KB */
/* KB ALLOCATED ON VOLUME */
/* FRAGMENTATION INDEX */
/* TARGET THRESHOLD */
/* TRIGGER THRESHOLD */
/* BEFORE OCCUPANCY */
/* AFTER OCCUPANCY */
/* PERCENT ELGIBLE TO MIGRATE */
/* SUMMARY TOTALS BY STORAGE GROUP, SMS AND NON-SMS: */
/* CAPACITY IN KB */
/* KB ALLOCATED */
/* PERCENT ALLOCATED */
/* TARGET THRESHOLD (IF STORAGE GROUP) */
/* TRIGGER THRESHOLD (IF STORAGE GROUP) */
/* SUMMARY TOTALS FOR DFHSM TAPE: */
/* BACKUP: TOTAL, FULL, PARTIAL AND EMPTY */
/* DUMP: TOTAL, FULL, PARTIAL AND EMPTY */
/* MIGRATE: TOTAL, FULL, PARTIAL AND EMPTY */
/* INPUT: SMS.UMB.COLLECT.RECTYPC */
/* TYPE C RECORDS */
/* SMS.UMB.DCOLLECT.RECTYPV */
/* TYPE V RECORDS */
/* SMS.UMB.DCOLLECT.RECTYPT */
/* TYPE T RECORDS */
/* OUTPUT: SMS.PMB.DCOLLECT.CAPACITY.DCCYYDDD */
/* PRESORT: FOR TYPE C RECORDS */
/* SORT FIELDS=(29,6,CH,A,35,4,CH,D) */
/* INCLUDE COND=(9,2,CH,EQ,C'C ') */
/* RECORD TYPE=V,LENGTH=(264,,264) */
/* */
/* FOR TYPE V RECORDS */
/* SORT FIELDS=(87,8,CH,A,29,6,CH,A) */
/* INCLUDE COND=(9,2,CH,EQ,C'V ') */
/* RECORD TYPE=V,LENGTH=(264,,264) */
/* */
/* FOR TYPE T RECORDS */
/* SORT FIELDS=(29,6,CH,A) */
/* INCLUDE COND=(9,2,CH,EQ,C'T ') */
/* RECORD TYPE=V,LENGTH=(264,,264) */
/* */
/**********************************************************************/
/***********************************************************/
/* OPEN THE INPUT FILE (CONTAINING DCOLLECT V RECORDS) */
/***********************************************************/
TRACE N
INNAME = "'SMS.UMB.DCOLLECT.RECTYPV'"
"ALLOC DD(INFILE) DA("INNAME") SHR"
IF RC^= 0 THEN DO
SAY 'ALLOCATION OF ('INNAME') FAILED'
EXIT 8
END
/***********************************************************/
/* OPEN THE INPUT FILE (CONTAINING DCOLLECT C RECORDS) */
/***********************************************************/
INNAME2 = "'SMS.UMB.DCOLLECT.RECTYPC'"
"ALLOC DD(INFILE2) DA("INNAME2") SHR"
IF RC^= 0 THEN DO
SAY 'ALLOCATION OF ('INNAME2') FAILED'
EXIT 8
END
/***********************************************************/
/* OPEN THE INPUT FILE (CONTAINING DCOLLECT T RECORDS) */
/***********************************************************/
INNAME = "'SMS.UMB.DCOLLECT.RECTYPT'"
"ALLOC F(INFILE3) DA("INNAME") SHR"
IF RC^= 0 THEN DO
SAY 'ALLOCATION OF ('INNAME') FAILED'
EXIT 8
END
/***********************************************************/
/* INITIALIZE VARIABLES */
/***********************************************************/
OUT_COUNT = 0
TOT_ALLOC_KB = 0
SMS_ALLOC_KB = 0
TOT_AVAIL_KB = 0
SMS_AVAIL_KB = 0
STG_ALLOC_KB. = 0
STG_AVAIL_KB. = 0
NONSMS_ALLOC_KB = 0
NONSMS_AVAIL_KB = 0
VOLSER = ' '
COL_DATE. = ' '
TARGET. = ' '
TRIGGER. = ' '
TARGET_STG. = ' '
TRIGGER_STG. = ' '
B4. = ' '
AFTER. = ' '
MIGELG. = ' '
STGRP_NAMES = ' '
/***********************************************************/
/* READ IN INPUT FILE WITH TYPE C RECORDS */
/***********************************************************/
"EXECIO * DISKR INFILE2 (FINIS STEM RECORD."
/***********************************************************/
/* PROCESS EACH RECORD UNTIL END-OF-FILE REACHED */
/***********************************************************/
DO K = 1 TO RECORD.0
PARSE VAR RECORD.K 1 . 25 UCVOLSR 31 UCCOLDT 35 UCFLAG1,
36 . 37 UCTOTAL 41 UCTGOCC 42 UCTROCC 43 UCBFOCC,
44 UCAFOCC 45 UCNOMIG 46 UCNINTV 47 UCINTVM 48
IF UCVOLSR \= VOLSER THEN DO
VOLSER = UCVOLSR
COL_DATE.VOLSER = LEFT(C2X(UCCOLDT),7)
TARGET.VOLSER = C2D(UCTGOCC)
TRIGGER.VOLSER = C2D(UCTROCC)
B4.VOLSER = C2D(UCBFOCC)
AFTER.VOLSER = C2D(UCAFOCC)
MIGELG.VOLSER = C2D(UCNOMIG)
END
END
/***********************************************************/
/* READ IN INPUT FILE WITH TYPE V RECORDS */
/***********************************************************/
"EXECIO * DISKR INFILE (FINIS STEM RECORD."
/***********************************************************/
/* PROCESS EACH RECORD UNTIL END-OF-FILE REACHED */
/***********************************************************/
DO K = 1 TO RECORD.0
PARSE VAR RECORD.K 1 . 5 DCURCTYP 7 DCUVERS 9 DCUSYSID,
13 DCUTIME 17 DCUDATE 21 .
PARSE VAR RECORD.K 1 . 25 DCVVOLSR 31 DCVFLAG1,
32 DCVERROR 33 . 36 DCVPERCT 37 DCVFRESP 41 DCVALLOC,
45 DCVVLCAP 49 DCVFRAGI 53 DCVLGEXT 57 DCVFREXT 61 DCVFDSCB,
65 DCFVIRS 69 DCVDVTYP 77 DCVDVNUM 79 . 83 DCVSGTCL 91 .
DATE = LEFT(C2X(DCUDATE),7)
IF K=1 THEN DO
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = "DCOLLECT RUN ON:" DATE
CALL OUTHEAD
END
VOLSER = DCVVOLSR
IF BITAND(DCVFLAG1,'03'X) = '03'X THEN DO /* IS IT SMS? */
SMS_ALLOC_KB = SMS_ALLOC_KB + C2D(DCVALLOC)
SMS_AVAIL_KB = SMS_AVAIL_KB + C2D(DCVVLCAP)
IF DCVSGTCL = ' ' THEN DCVSGTCL = 'NO_GROUP'
END
SELECT
WHEN SUBSTR(VOLSER,1,2) = 'ML' THEN
TARGTRIG = (TARGET.VOLSER||"/"||TRIGGER.VOLSER)
WHEN DCVSGTCL = ' ' | DCVSGTCL = 'NO_GROUP' THEN
TARGTRIG = ' '
OTHERWISE
TARGTRIG = (TARGET.VOLSER||"/"||TRIGGER.VOLSER)
END
/***********************************************************/
/* BUILD LIST OF STORAGE GROUP NAMES */
/* AND PROCESS KBYTES INFORMATION BY STORAGE GROUP */
/***********************************************************/
IF DCVSGTCL \= ' ' THEN DO
IF WORDPOS(DCVSGTCL,STGRP_NAMES,1) = 0 THEN DO
STGRP_NAMES = STGRP_NAMES DCVSGTCL
L = WORDPOS(DCVSGTCL,STGRP_NAMES,1)
TARGET_STG.L = TARGET.DCVVOLSR
TRIGGER_STG.L = TRIGGER.DCVVOLSR
END
L = WORDPOS(DCVSGTCL,STGRP_NAMES,1)
STG_ALLOC_KB.L = STG_ALLOC_KB.L + C2D(DCVALLOC)
STG_AVAIL_KB.L = STG_AVAIL_KB.L + C2D(DCVVLCAP)
END
ELSE DO
NONSMS_ALLOC_KB = NONSMS_ALLOC_KB + C2D(DCVALLOC)
NONSMS_AVAIL_KB = NONSMS_AVAIL_KB + C2D(DCVVLCAP)
END
/***********************************************************/
/* BUILD TOTALS */
/***********************************************************/
TOT_ALLOC_KB = TOT_ALLOC_KB + C2D(DCVALLOC)
TOT_AVAIL_KB = TOT_AVAIL_KB + C2D(DCVVLCAP)
/***********************************************************/
/* PUT OUT VOLUME DETAIL RECORD */
/***********************************************************/
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(COL_DATE.VOLSER,7),
LEFT(DCVSGTCL,8),
RIGHT(DCVVOLSR,6),
RIGHT(C2D(DCVVLCAP),10),
RIGHT(C2D(DCVALLOC),10),
RIGHT(C2D(DCVFRAGI),6),
CENTER(TARGTRIG,7),
RIGHT(B4.VOLSER,6),
RIGHT(AFTER.VOLSER,6),
RIGHT(MIGELG.VOLSER,4)
END
/***********************************************************/
/* OPEN THE OUTPUT FILE FOR THE SUMMARIZED BY DSN REPORT */
/***********************************************************/
OUTNAME = "'SMS.PMB.DCOLLECT.CAPACITY.D"||DATE||"'"
"ALLOC DSNAME("||OUTNAME||")",
"DSORG(PS) LRECL(80) RECFM(F B) ",
"TRACKS SPACE(4,5) RELEASE DDNAME(OUTDD)"
IF RC^= 0 THEN DO
SAY 'ALLOC OF ('||OUTNAME||') FAILED'
EXIT 12
END
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT("++++",80,"+")
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(" ",7),
LEFT(" ",8),
RIGHT(" ",6),
RIGHT("CAPACITY",12),
RIGHT("ALLOCATED",12),
CENTER("PERCENT",9),
CENTER("TARGET/",7)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(" ",7),
LEFT(" ",8),
RIGHT(" ",6),
RIGHT("IN KBYTES",12),
RIGHT("IN KBYTES",12),
CENTER("ALLOCATED",9),
CENTER("TRIGGER",7)
/***********************************************************/
/* PUT OUT TOTALS BY STORAGE GROUP, SMS AND GRAND TOTAL */
/***********************************************************/
L = WORDS(STGRP_NAMES)
DO K = 1 TO L
PRCNT_ALC = FORMAT(((STG_ALLOC_KB.K/STG_AVAIL_KB.K)*100),3,1)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(' ',7),
RIGHT(WORD(STGRP_NAMES,K),8),
LEFT(" ",6),
RIGHT(STG_AVAIL_KB.K,12),
RIGHT(STG_ALLOC_KB.K,12),
RIGHT(PRCNT_ALC,9),
CENTER(TARGET_STG.K||"/"||TRIGGER_STG.K,7)
END
PRCNT_ALC = FORMAT(((SMS_ALLOC_KB/SMS_AVAIL_KB)*100),3,1)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(' ',7),
RIGHT("SMS",8),
LEFT(" ",6),
RIGHT(SMS_AVAIL_KB,12),
RIGHT(SMS_ALLOC_KB,12),
RIGHT(PRCNT_ALC,9)
PRCNT_ALC = FORMAT(((NONSMS_ALLOC_KB/NONSMS_AVAIL_KB)*100),3,1)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(' ',7),
RIGHT("NON-SMS",8),
LEFT(" ",6),
RIGHT(NONSMS_AVAIL_KB,12),
RIGHT(NONSMS_ALLOC_KB,12),
RIGHT(PRCNT_ALC,9)
PRCNT_ALC = FORMAT(((TOT_ALLOC_KB/TOT_AVAIL_KB)*100),3,1)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(' ',7),
RIGHT("TOTAL",8),
LEFT(" ",6),
RIGHT(TOT_AVAIL_KB,12),
RIGHT(TOT_ALLOC_KB,12),
RIGHT(PRCNT_ALC,9)
/***********************************************************/
/* PROCESS EACH T RECORD UNTIL END-OF-FILE REACHED */
/***********************************************************/
UTALL = 0
UTTOT = 0
UTTOTFULL = 0
UTTOTPART = 0
UTTOTEMP = 0
EOF = 'NO'
CALL OUTHEADT
TRACE N
DO WHILE EOF='NO'
"EXECIO 1 DISKR INFILE3"
IF RC^= 0 THEN
EOF = 'YES'
ELSE DO
PARSE PULL RECORD
/***********************************************************/
/* DETERMINE THE RECORD TYPE (M,B,C,T,D,A,V) */
/***********************************************************/
DCURCTYP=SUBSTR(RECORD,5,2)
SELECT
/***********************************************************/
/* PROCESS TAPE DATA SET INFORMATION RECORD */
/***********************************************************/
WHEN(DCURCTYP='T ') THEN DO
CALL DCTRECP
IF UTSTYPE = B THEN TYPE = "BACKUP "
IF UTSTYPE = M THEN TYPE = "MIGRATE"
IF UTSTYPE = D THEN TYPE = "DUMP "
UTALL = UTFULL + UTPART + UTEMPTY
UTTOT = UTALL + UTTOT
UTTOTFULL = UTFULL + UTTOTFULL
UTTOTPART = UTPART + UTTOTPART
UTTOTEMP= UTEMPTY + UTTOTEMP
CALL OUTDET
END
OTHERWISE
END
END
END
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT("TOTAL",9),
RIGHT(UTTOT,7),
RIGHT(UTTOTFULL,7),
RIGHT(UTTOTPART,7),
RIGHT(UTTOTEMP,7)
"EXECIO * DISKW OUTDD (FINIS STEM OUT_LINE."
"FREE ALL"
EXIT
/***********************************************************/
/* PUT OUT A HEADER LINE */
/***********************************************************/
OUTHEAD:
/* */
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER(" ",7),
LEFT(" ",8),
RIGHT(" ",6),
RIGHT("VOLUME",10),
RIGHT("VOLUME",10),
RIGHT(" ",6),
RIGHT(" ",7),
CENTER(" ",6),
CENTER(" ",6),
CENTER("%",4)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER("COLLECT",7),
LEFT("STORAGE",8),
RIGHT(" ",6),
RIGHT("CAPACITY",10),
RIGHT("ALLOCATED",10),
CENTER("FRAG",6),
CENTER("TARGET/",7),
CENTER("BEFORE",6),
CENTER("AFTER",6),
CENTER("MIGR",4)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = CENTER("DATE",7),
LEFT("GROUP",8),
RIGHT("VOLSER",6),
RIGHT("IN KBYTES",10),
RIGHT("IN KBYTES",10),
CENTER("INDEX",6),
CENTER("TRIGGER",7),
CENTER("OCCUPY",6),
CENTER("OCCUPY",6),
CENTER("ELG",4)
RETURN
/***********************************************************/
/* PARSE TAPE CAPACITY PLANNING RECORD */
/***********************************************************/
DCTRECP:
/* */
PARSE VAR RECORD 1 . 5 DCURCTYP 7 DCUVERS 9 DCUSYSID,
13 DCUTIME 17 DCUDATE 21 . ,
25 UTSTYPE 26 . ,
29 UTFULL 33 UTPART 37 UTEMPTY 41
UTFULL = C2D(UTFULL)
UTPART = C2D(UTPART)
UTEMPTY = C2D(UTEMPTY)
RETURN
/***********************************************************/
/* PRINT OUT TAPE HEADINGS */
/***********************************************************/
OUTHEADT:
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT("++++",80,"+")
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT("HSM TAPES",9),
RIGHT("TOTAL",7),
RIGHT("FULL",7),
RIGHT("PARTIAL",7),
RIGHT("EMPTY",7)
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT("---------",9),
RIGHT("-------",7),
RIGHT("-------",7),
RIGHT("-------",7),
RIGHT("-------",7)
RETURN
/***********************************************************/
/* PRINT OUT TAPE TYPES */
/***********************************************************/
OUTDET:
OUT_COUNT = OUT_COUNT + 1
OUT_LINE.OUT_COUNT = LEFT(TYPE,9),
RIGHT(UTALL,7),
RIGHT(UTFULL,7),
RIGHT(UTPART,7),
RIGHT(UTEMPTY,7)
RETURN