Populating system stats

Program TJ8953R populates file TJ8953D with the same information that can be viewed with the WRKSYSSTS command using IBM's API QWCRSSTS.

Program TJ8953R populates file TJ8953D with the same information that can be viewed with the WRKSYSSTS command using IBM's API QWCRSSTS.

 
A          R TJ8953F

A            SYSTEMNAME     8          TEXT('SYSTEM NAME')             
A            RUNDATE         Z         TEXT('RUN DATE AND TIME')       
A*  FORMAT SSTS0100                                                    
A* NUMBER OF USERS SIGNED ON                                           
A            USERSSO       11P 0       TEXT('USERS SIGNED ON')         
A* NUMBER OF BATCH JOBS RUNNING                                        
A            BTCHJOBSR     11P 0       TEXT('BATCH JOBS RUNNING')      
A* NUMBER OF BATCH JOBS IN QUEUE                                       
A            BTCHJOBSQ     11P 0       TEXT('BATCH JOBS IN QUEUE')     
A* NUMBER OF BATCH JOBS ON HOLD                                        
A            BTCHJOBSH     11P 0       TEXT('BATCH JOBS ON HOLD')      
A* NUMBER OF BATCH JOBS ENDED WITH PRINT WAITING                       
A            BTCHJOBSP     11P 0       TEXT('# OF PRINT JOBS WAITING') 
A*  FORMAT SSTS0200                                                    
A* ELAPSED TIME                                                        
A            ELAPSEDTME     8          TEXT('WRKSYSSTS ELAPSED TIME')  
A* NUMBER OF PROCESSORS                                                
A            PROCESSORS    11P 0       TEXT('# OF PROCESSORS')         
A* AMOUNT OF MAIN STORATE                                              
A            MAINSTORAG    11P 3       TEXT('AMT OF MAIN STORAGE')     
A* NUMBER OF JOBS IN SYSTEM                                            
A            JOBSINSYS     11P 0       TEXT('JOBS IN SYSTEM')          
A* NUMBER OF ACTIVE JOBS IN SYSTEM

A            JOBSINSYSA    11P 0       TEXT('# OF ACTIVE JOBS IN
SYSTEM')  
A* AMOUNT OF DASD IN GIG

A            DASDINGIG     11P 4       TEXT('AMT OF DASD IN GIG')

A* DASD USED PERCENT

A            DASDUSD       11P 2       TEXT('% OF DASD USED')

A* CPU USAGE PERCENT

A            CPUUSAGE      11P 2       TEXT('% OF CPU USED')

A* DATA BASE PERCENT

A            DTABASUSD     11P 3       TEXT('% OF DATA BASE USED')

A* PERMANENT ADDESSES USED PERCENT

A            PRMADRUSD     11P 3       TEXT('% OF PERM ADDR USED')

A* TEMPORARY ADDESSES USED PERCENT

A            TMPADRUSD     11P 3       TEXT('% OF TEMP ADDR USED')

A* CURRENT UNPROTECTED STORAGE USED

A            CURUNPUSD     11P 0       TEXT('AMT OF UNPROCTED STG USED')

A* MAXIMUM UNPROTECTED STORAGE USED

A            MAXUNPUSD     11P 0       TEXT('MAX UNPROTECTED STG USED')

A* CURRENT PROCESSING CAPACITY

A            CURPROCAP     11P 0       TEXT('CUR PROCESSING CAPACITY')

A* CURRENT INTERACTIVE PERFORMANCE

A            CURINTPER     11P 0       TEXT('CUR INTERACTIVE
PERFORMANCE') 
A*  FORMAT SSTS0300

A* DATA BASE FAULTS

A            DBFAULTS      11P 1       TEXT('DB FAULTS')            
A* DATA BASE PAGES                                                  
A            DBPAGES       11P 1       TEXT('DB PAGES')             
A* NON DATA BASE FAULTS                                             
A            NONDBFAULT    11P 1       TEXT('NON DB FAULTS')        
A* NON DATA BASE PAGES                                              
A            NONDBPAGES    11P 1       TEXT('NON DB PAGES')         
A* ACTIVE TO WAIT                                                   
A            ACTIVETW      11P 1       TEXT('ACTIVE TO WAIT')       
A* WAIT   TO INELIGIBLE                                             
A            WAITTI        11P 1       TEXT('WAIT TO INELIGIBLE')   
A* ACTIVE TO INELIGIBLE                                             
A            ACTIVETI      11P 1       TEXT('ACTIVE TO INELIGIBLE') 
A          K SYSTEMNAME                                             
A          K RUNDATE                                                

 *  written by James H Greene on 2004/02/20

 *             TRIPLEJ, INC

 *             801-673-2233

 *             JGreene@FBFS.com

 *  collect system status info via API QWCRSSTS into DB file tj8953d

 *  the stats collected are the ones seen when using the WRKSYSSTS

h dftactgrp(*no) actgrp(*caller)

f* tj8953d is collection of system stats that are retreived by this
pgmgram 
ftj8953d   o    e             disk

d returndata      s           2560

d datalength      s              4b 0 inz(2560)

d ssts0100        s              8    inz('SSTS0100')

d ssts0200        s              8    inz('SSTS0200')

d ssts0300        s              8    inz('SSTS0300')

d rcdfmt          s              8

d resetstatus     s             10    inz('*NO')

d rundate         s               z   inz(*sys)

d x               s              5  0

d errorcode       s             10

d* location of data in record format SSTS0100

d s0100           ds                  inz

d status0100              1    256

d systemname             17     24

d userssob               25     28b 0               
d btchjobsrb             49     52b 0               
d btchjobsqb             61     64b 0               
d btchjobshb             65     68b 0               
d btchjobspb             77     80b 0               
d* location of data in record format SSTS0200       
d s0200           ds                  inz           
d status0200              1    256                  
d elapsedtim             25     30                  
d cpuusageb              33     36b 0               
d jobsinsysb             37     40b 0               
d prmadrusdb             41     44b 0               
d tmpadrusdb             45     48b 0               
d dasdingigb             49     52b 0               
d dasdusdb               53     56b 0               
d curunpusdb             61     64b 0               
d maxunpusdb             65     68b 0               
d dtabasusdb             69     72b 0               
d mainstoragb            73     76b 0               
d curprocapb             89     92b 0               
d processorb             97    100b 0               
d jobsinsysab           101    104b 0               
d curintperb            128    131b 0               
d s0300           ds                  inz           
d* pool data location info for record format SSTS0300   
d status0300              1    256                      
d nop                    33     36b 0                   
d otpi                   37     40b 0                   
d lopi                   41     44b 0                   
d* location of data in record format SSTS0300           
d s0300offset     ds                  inz               
d dbfaultsb               1      4b 0                   
d dbfaultsa               1      4                      
d dbpagesb                5      8b 0                   
d dbpagesa                5      8                      
d nondbfaulb              9     12b 0                   
d nondbfaula              9     12                      
d nondbpageb             13     16b 0                   
d nondbpagea             13     16                      
d activetwb              17     20b 0                   
d activetwa              17     20                      
d waittib                21     24b 0                   
d waittia                21     24                      
d activetib              25     28b 0                   
d activetia              25     28                      
c* get status info contained in record format SSTS0100  
c                   eval      rcdfmt = ssts0100         
c                   call      'QWCRSSTS'                           
c                   parm                    returndata             
c                   parm                    datalength             
c                   parm                    rcdfmt                 
c                   parm                    resetstatus            
c                   parm                    errorcode              
c                   eval      s0100 = %subst(returndata:1:80)      
c                   eval      usersso = userssob                   
c                   eval      btchjobsr  = btchjobsrb              
c                   eval      btchjobsq  = btchjobsqb              
c                   eval      btchjobsh  = btchjobshb              
c                   eval      btchjobsp  = btchjobspb              
c* get status info contained in record format SSTS0200             
c                   eval      rcdfmt = ssts0200                    
c                   call      'QWCRSSTS'                           
c                   parm                    returndata             
c                   parm                    datalength             
c                   parm                    rcdfmt                 
c                   parm                    resetstatus            
c                   parm                    errorcode              
c                   eval      s0200 = %subst(returndata:1:131)     
c                   eval      elapsedtme = %subst(elapsedtim:1:2) +
c                             ':' + %subst(elapsedtim:3:2)   +     
c                             ':' + %subst(elapsedtim:5:2)        
c                   eval      cpuusage   = (cpuusageb/10)         
c                   eval      prmadrusd  = (prmadrusdb/1000)      
c                   eval      tmpadrusd  = (tmpadrusdb/1000)      
c                   eval      jobsinsys  = jobsinsysb             
c                   eval      dasdingig  = (dasdingigb/1000)      
c                   eval      dasdusd    = (dasdusdb/10000)       
c                   eval      curunpusd  = curunpusdb             
c                   eval      maxunpusd  = maxunpusdb             
c                   eval      dtabasusd  = (dtabasusdb/10)        
c                   eval      mainstorag = (mainstoragb/1000)     
c* following 4 fields are only available in release V5R2 and above
c*                  eval      processors = processorb             
c*                  eval      jobsinsysa = jobsinsysab            
c*                  eval      curprocap  = curprocapb             
c*                  eval      curintper  = curintperb             
c* get status info contained in record format SSTS0300            
c                   eval      rcdfmt = ssts0300                   
c                   call      'QWCRSSTS'                          
c                   parm                    returndata            
c                   parm                    datalength            
c                   parm                    rcdfmt                
c                   parm                    resetstatus           
c                   parm                    errorcode

c                   eval      s0300 = %subst(returndata:1:80)

c                   eval      x = 1

c* do for number of storage pools on system

c* collect pool stats - accumulaton of all pools

c                   dou       x > nop

c                   eval      dbfaultsa = %subst(returndata:(otpi + 17 +

c                             ((x - 1) * lopi)):4)

c                   eval      dbfaults = dbfaults + dbfaultsb/10

c                   eval      dbpagesa = %subst(returndata:(otpi + 21 +

c                             ((x - 1) * lopi)):4)

c                   eval      dbpages  = dbpages + dbpagesb/10

c                   eval      nondbfaula = %subst(returndata:(otpi + 25
+
c                             ((x - 1) * lopi)):4)

c                   eval      nondbfault = nondbfault + nondbfaulb/10

c                   eval      nondbpagea = %subst(returndata:(otpi + 29
+
c                             ((x - 1) * lopi)):4)

c                   eval      nondbpages = nondbpages + nondbpageb/10

c                   eval      activetwa = %subst(returndata:(otpi + 33 +

c                             ((x - 1) * lopi)):4)

c                   eval      activetw   = activetw + activetwb/10

c                   eval      waittia  = %subst(returndata:(otpi + 37 +

c                             ((x - 1) * lopi)):4)

c                   eval      waitti     = waitti   + waittib/10        
c                   eval      activetia = %subst(returndata:(otpi + 41 +
c                             ((x - 1) * lopi)):4)                      
c                   eval      activeti   = activeti + activetib/10      
c                   eval      x = x + 1                                 
c                   enddo                                               
c* write status info to file                                            
c                   write     tj8953f                                   
c                   eval      *inlr = *on                               
  
  


This was first published in August 2005

Dig deeper on Performance

0 comments

Oldest 

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:

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close