Page 2 of 3

Re: Help wanted in understanding Z variables

PostPosted: Wed Sep 23, 2009 1:31 am
by dick scherrer
Hello,

the output file just contains the names of all the datasets and garbage characters no other information
Please post a small amount of the data using tso/ispf browse. Make sure the info is displayed using HEX ON. I suspect that the "garbage" is the real data - only it is in binary or packed decimal format. There may also be info that is "bit-level" in this data.

HEX ON will produce output that shows the hexidecimal values (most of which are non-display characters). This is similar to an "xd" in unix if i remember correctly.

Re: Help wanted in understanding Z variables

PostPosted: Wed Sep 23, 2009 3:04 am
by enrico-sorichetti
let' s answer the simple questions first
Please let me know if this is a valid concern to know how to save ISPF panles info into a dataset for further processing via REXX.
is this a normal practice in main-frame woirld or not?

NOT a valid concern, NOT a normal practice ( whatever the world ), just a LOSS of time
if something is worth saving usually ISPF lets You do it with a save command

Any way I just wanted to learn how can I save the ISPF pannel infomation for further processing, if not for VTOC then this can be used
for many other tasks.

Your time could be better spent in proper training and manual reading
search http://www.redbooks.ibm.com/ for

ABC of System Programming OS/390
vol01 sg245597.pdf
vol02 sg245652.pdf
vol03 sg245653.pdf
vol04 sg245654.pdf
vol05 sg245655.pdf

ABC of System Programming zOS

vol01 sg246981.pdf
vol02 sg246982.pdf
vol03 sg246983.pdf
vol05 sg246985.pdf
vol06 sg246986.pdf
vol07 sg246987.pdf
vol08 sg246988.pdf
vol09 sg246989.pdf
vol10 sg246990.pdf
vol11 sg246327.pdf

zOS_VSAM_Demystified sg246105.pdf
zOS_basics sg246366.pdf

As you probalbly guessed it alreday I am very new to main-frame and has been thrown into this from a Unix world so I
still think unixly.

irrelevant to the discussion, it is not an excuse anway for the following quotes
but I had already imagined that, typical unix attitude, It takes time to search for it so I am going to rehinvent the wheel

We dont have SMS or DFSMS in our shop.

hard to believe.. unless You are using a prehystoric operating system

finally the worst of all
When i try to run DCCOLLEct of IDCMS as mentioned by you the output file just contains the names of all the datasets and garbage characters no other information.

are You serious... :evil: even if You come from the unix world You should know about the basics of data representation...
otherwise it would be better for You to meditate if IT is the right career
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

anyway I was almost forgetting it, fastest, the work has been done already
look at the ISMF dialogs, the info is right there, get a volume list,
save it in a sequential dataset and no need to rehinvent the wheel,
or .... http://publib.boulder.ibm.com/infocente ... 0/dcol.htm


or if You really want to process the volume records from DCOLLECT here are a couple of snippets that might become handy
they are taken from the CBT file 206 and the proper copyright applies

the parse routines for the different record types
./   ADD NAME=DCBRECP                                                           
/***********************************************************/                   
/* PARSE   BACKUP   DATA SET INFORMATION RECORD -          */                   
/***********************************************************/                   
 DCBRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 1 . 25 UBDSNAM 69 UBFLAG1 70 UBDEVCL,                       
      71 UBDSORG 73 UBDSIZE 77 UBTIME 81 UBDATE 85 . 87 UBDATCL,               
      117 . 119 UBSTGCL 149 . 151 UBMGTCL 181 UBRECRD 182 UBRECOR,             
      183 UBBKLNG 185 UBFLAG2 186 . 187 UBNMIG 189 UBALLSP,                     
      193 UBUSESP 197 UBRECSP 200                                               
 RETURN                                                                         
./   ADD NAME=DCCRECP                                                           
/***********************************************************/                   
/* PARSE  CAPACITY INFORMATION RECORD -                    */                   
/***********************************************************/                   
 DCCRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 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                             
                                                                               
 RETURN                                                                         
./   ADD NAME=DCDRECP                                                           
/***********************************************************/                   
/* PARSE   ACTIVE   DATA SET INFORMATION RECORD -          */                   
/***********************************************************/                   
 DCDRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 1 . 25 DCDDSNAM 69 DCDERROR 70,                             
      70 DCDFLAG1 71 DCDFLAG2 72 . 75 DCDDSORG 77 DCDRECRD,                     
      78 DCDNMEXT 79 DCDVOLSR 85 DCDBKLNG 87 DCDLRECL,                         
      89 DCDALLSP 93 DCDUSESP 97 DCDSCALL 101 DCDNMBLK,                         
      105 DCDCREDT 109 DCDEXPDT 113 DCDLSTRF 117 DCDDSSER,                     
      123 DCDVOLSQ 125 DCDLBKDT 133 . 135 DCDDATCL,                             
      143 . 167 DCDSTGCL 175 . 199 DCDMGTCL,                                   
      207 . 231 DCDSTGRP 239 .                                                 
 RETURN                                                                         
./   ADD NAME=DCMRECP                                                           
/***********************************************************/                   
/* PARSE   MIGRATED DATA SET INFORMATION RECORD -          */                   
/***********************************************************/                   
 DCMRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 1 . 25 UMDSNAM 69 UMFLAG1 70 UMDEVCL,                       
      71 UMDSORG 73 UMDSIZE 77 UMTIME 81 UMDATE 85 . 87 UMDATCL,               
      117 . 119 UMSTGCL 149 . 151 UMMGTCL 181 UMRECRD 182 UMRECOR,             
      183 UMBKLNG 185 UMFLAG2 186 . 187 UMNMIG 189 UMALLSP,                     
      193 UMUSESP 197 UMRECSP 201 UMCREDT 205 UMEXPDT 209 UMLBKDT,             
      217 UMLRFDT                                                               
 RETURN                                                                         
./   ADD NAME=DCURECP                                                           
/***********************************************************/                   
/* PARSE DCOLLECT HEADER INFORMATION - ALL RECORD TYPES    */                   
/***********************************************************/                   
 DCURECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 1 . 5 DCURCTYP 7 DCUVERS 9 DCUSYSID,                       
      13 DCUTIME 17 DCUDATE 21 .                                               
 RETURN                                                                         
./   ADD NAME=DCTRECP                                                           
/***********************************************************/                   
/* PARSE   TAPE CAPACITY PLANNING RECORD                   */                   
/***********************************************************/                   
 DCTRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 1 . 25 UTSTYPE 26 . ,                                       
      29 UTFULL 33 UTPART 37 UTEMPTY 41                                         
 RETURN                                                                         
./   ADD NAME=DCVRECP                                                           
/***********************************************************/                   
/* PARSE   VOLUME INFORMATION RECORD -                     */                   
/***********************************************************/                   
 DCVRECP:                                                                       
/*                                                          */                 
   PARSE VAR RECORD 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 .                 
 RETURN                                                                         


the Volume records processor
./   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                                                                       

Re: Help wanted in understanding Z variables

PostPosted: Wed Sep 23, 2009 3:39 am
by enrico-sorichetti
the output file just contains the names of all the datasets and garbage characters no other information

what You believe garbage characters can be decoded/understood/interpreted looking at
http://publib.boulder.ibm.com/infocente ... recstr.htm

Re: Help wanted in understanding Z variables

PostPosted: Wed Sep 23, 2009 9:15 pm
by arshadhrashid
The status on the main-screen still shows enrico-sorichetti for last update, however the last update was from me arshadhrashid.
FYI.

Re: Help wanted in understanding Z variables

PostPosted: Wed Sep 23, 2009 9:55 pm
by enrico-sorichetti
The status on the main-screen still shows enrico-sorichetti for last update, however the last update was from me arshadhrashid.


when was Your last post/update ? ( one with a meaningful content for the topic )
looking at the whole topic it was on ... Tue Sep 22, 2009 9:54 pm

Re: Help wanted in understanding Z variables

PostPosted: Thu Sep 24, 2009 10:10 pm
by arshadhrashid
Thank you sir I will get back to you as soon as I am done looking into all of your suggestion.

Re: Help wanted in understanding Z variables

PostPosted: Fri Oct 09, 2009 4:41 am
by arshadhrashid
Hello Sir,
Hope your doing OK. you were too harsh on me as I am in my IT career for last 20 yrs and its not possoble to chnage it now.
Any way you need to see the frustration that a unix admin has to go thru. A simpl df commnad in unix will tell me all the info I wanted about a volume and here I am going thru a rocket science just to get the same info.

Any way I ran the utility you mentioned as

//DISK DD UNIT=3390,VOL=SER=KDT002,DISP=OLD
//SYSIN DD *
LISTVTOC FORMAT,VOL=3390=KDT002
/*
//

It gave me a listing of all the data sets on that volume. You want me to find out volume utilization from this 2,000 lines output?

this is not what I want I just want to know what is the volume utilzaition for a given volume , is it too much to ask?

thanks.

Re: Help wanted in understanding Z variables

PostPosted: Sat Oct 10, 2009 12:03 am
by dick scherrer
Hello,

Moving from a technology you know/understand/enjoy is almost always frustrating. . .

Is this possibly what you are looking for?
.-------------------------- VTOC Summary Information --------------------------.
| Volume . : MWD158                                                            |
| Command ===>                                                                 |
|                                                                              |
| Unit . . : 3390                                                              |
|                                                                              |
|  Volume Data             VTOC Data              Free Space   Tracks    Cyls  |
|  Tracks . :   50,085     Tracks  . :        70  Size  . . :   5,613     369  |
|  %Used  . :       88     %Used . . :         2  Largest . :   2,340     156  |
|  Trks/Cyls:       15     Free DSCBS:     3,441  Free                         |
|                                                 Extents . :      36          |
|                                                                              |
|                                                                              |
'------------------------------------------------------------------------------'
If you log onto tso/ispf, select option 3.4, enter V in that Option field and your VOLSER in the Volume Serial field, you will see this utilization information.

Re: Help wanted in understanding Z variables

PostPosted: Sat Oct 10, 2009 3:04 am
by arshadhrashid
Thanks for your input again.
But this is all manual I know I can get this info whenever I want by logging-on and using 3.4.

I want have this information in a dataset for all the volumes that we have.

I looked into all the utilities you mentioned I am not trying to re-invent the wheel just a simple task of colecting volume utilzation.
The IDCSM DCCollect presents a list of all dataset with garbage characters and yes garbage characters. here is the example

000001,,h,,V ,,BAT ,<+,,,,,,,,,KDT003,,,,,ñ,,¹ï,,?N,,¢,,,,,,,ûÒ,,,,,,,,,,,,3390
000002,,&,,D ,,BAT ,<+,,,,,,,,,SYS1.VVDS.VKDT003 ,,,,
000003,,ö,,A ,,BAT ,<+,,,,,,,,,SYS1.VVDS.VKDT003 SYS1
000004,,&,,D ,,BAT ,<+,,,,,,,,,DB2KDP.DSNDBD.TEMDB.TMPDBASE.I0001.A001 ,,,,
000005,,ö,,A ,,BAT ,<+,,,,,,,,,DB2KDP.DSNDBD.TEMDB.TMPDBASE.I0001.A001 DB2K
000006,,&,,D ,,BAT ,<+,,,,,,,,,DSCJSKDT.DSNDBD.JRSDB001.IX002.I0001.A001 ,,,,
000007,,ö,,A ,,BAT ,<+,,,,,,,,,DSCJSKDT.DSNDBD.JRSDB001.IX002.I0001.A001 DSCJ
000008,,&,,D ,,BAT ,<+,,,,,,,,,DSCJSKDT.DSNDBD.JRSDB001.IX003.I0001.A001 ,,,,

What will I do with this DATA?

Another option of IDCMS uses a utility called ACBJBAOB, which we dont have in our shop.

now you tell me I am trying to re-invnet the wheel of simply wish I could have a df -k comamd like Unix.

If it was unix with one command I get info like this

Volume 1 20% used
Volume 2 50% used and so on so forth.

Just think about my request with a cool mind. Am I asking too much from the ALLMightY MAIN FRAME?

Re: Help wanted in understanding Z variables

PostPosted: Sat Oct 10, 2009 3:45 am
by dick scherrer
Hello,

Well, you are still simply flailing away. . . Those are NOT garbage characters - they are simply data you do not yet understand. Repeating what i posted more than 2 weeks ago:
Please post a small amount of the data using tso/ispf browse. Make sure the info is displayed using HEX ON. I suspect that the "garbage" is the real data - only it is in binary or packed decimal format. There may also be info that is "bit-level" in this data.
Now, i suggest you do as requested and post that data with HEX ON and via the "Code" bbTag.

fwiw - you don't seem to realize that there are multiple people here trying to reply to your topic. you do seem to have placed yourself in the position of "you against the mainframe" or "you against the forum" - both are most unproductive.

As i mentioned before, completely different technology is frustrating. If you really, really like the VI editor, i suspect that the standard mainframe editor will come up short as well ;)