Retrieve and print DASD usage by library

This program prints the library size for the last 24 runs of the Get Library Size Program. If the Get Library Size Program is run once per month, this program will print the last 24 months of data for each library all on one line. This makes it very easy to see trends for a library.

f* written by James Greene on March 13, 2004

f*  TRIPLEJ Inc.                                                  
f*  TRIPLEJ46@hotmail.com                                         
f*  Program ID   -  TJ7004R  - Print Historical DASD usage report 
ftj7001p   if   e             disk                                
ftj7000p   if   e           k disk                                
fqsysprt   o    f  192        printer oflind(*in02) usropn        
d command         s            128    inz('OVRPRTF FILE(QSYSPRT) +
d                                     PAGESIZE(*N 192)')          
d cmdlength       s             15  5 inz(128)                    
d y               s              2  0                             
d mm              s              2                                
d dd              s              2                                
d today           s               d   datfmt(*iso)                
d lrsize          s              4  0 dim(24)                     
d libsize         s              5  1 dim(24)                     
d mmdd            s              6    dim(24)                     
d                 ds                                              
d data                          40    dim(24) descend                  
d size                          15  0 overlay(data) inz                
d dates                           d   overlay(data:16) datfmt(*iso) inz
D PGMST          SDS                                                   
D  #PGMNM           *PROC                                              
D  #PARMS           *PARMS                                             
D  #WSID                244    253                                     
D  #USER                254    263                                     
c*** get last 24 dates *******************************************     
c                   exsr      last24                                   
c*** print report ************************************************     
c                   exsr      printrpt                                 
c*** lr stuff     ************************************************     
c                   eval      *inlr = *on                              
c     *inzsr        begsr                                              
c                   call      'QCMDEXC'                                
c                   parm                    command                    
c                   parm                    cmdlength                   
c                   open      qsysprt                                   
c                   endsr                                               
c     printrpt      begsr                                               
c                   dou       %eof(tj7001p)                             
c                   read      tj7001p                                   
c                   if        not %eof(tj7001p)                         
c     odobnm        setll     tj7000p                                   
c                   dou       %eof(tj7000p)                             
c     odobnm        reade     tj7000p                                   
c                   if        not %eof(tj7000p)                         
c                   eval      y = 1                                     
c                   move      date          today                       
c     today         lookup    dates(y)                               01 
c                   if        %found                                    
c                   eval      size(y) = currentsz                       
c                   endif                                               
c                   endif                                          
c                   enddo                                          
c                   eval      libsize = (size / 1000000000)        
c                   except    detail                               
c                   if        *in02                                
c                   except    heading                              
c                   eval      *in02 = *off                         
c                   endif                                          
c                   eval      lrsize = lrsize + (size / 1000000000)
c                   eval      size = 0                             
c                   endif                                          
c                   enddo                                          
c                   except    lrline                               
c                   endsr                                          
c     last24        begsr                                          
c     'QGPL      '  setll     tj7000p                              
c                   eval      y = 0                                
c                   dou       %eof(tj7000p)           
c     'QGPL      '  reade     tj7000p                 
c                   if        not %eof(tj7000p)       
c                   eval      y = y + 1               
c                   move      date          today     
c                   eval      dates(y) = today        
c                   if        y >= 24                 
c                   eval      y = 1                   
c                   endif                             
c                   endif                             
c                   enddo                             
c                   sorta     dates                   
c                   eval      y = 0                   
c                   dou       y = 24                  
c                   eval      y = y + 1               
c                   extrct    dates(y):*m   mm        
c                   extrct    dates(y):*d   dd        
c                   eval      mmdd(y) = mm + '/' + dd 
c                   enddo                                             
c                   except    heading                                 
c                   endsr                                             
Oqsysprt   e            heading        2 01                           
o                       udate         y     10                        
O                       #pgmnm              22                        
O                                           75 'Historical DASD Usage'
O                       #user              112                        
Oqsysprt   e            heading        2                              
O                                           10 'Library'              
O                       mmdd               159                        
Oqsysprt   e            detail         1                              
O                       odobnm              11                        
O                       libsize            158 '   0. '               
Oqsysprt   e            lrline         1                              
o                                           11 'ALL Libs'             
O                       lrsize             156 '&&   0'               



The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was first published in March 2004

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.