Calculating averages

Averages are calculated by dividing the field value by the task count (TASKCNT).

The following query calculates the average response time.
SELECT TRAN,                                                         
       INT(SUM(TASKCNT))                        AS "Task Cnt",        
       DEC(SUM(RESPONSE_TIME),8,4)              AS "Response Time Tot",
       DEC(SUM(RESPONSE_TIME)/SUM(TASKCNT),8,4) AS "Response Time Ave" 
FROM CICSPA.CICSP1H                                                
GROUP BY TRAN                                                         
ORDER BY TRAN                                                         
This query produces output like the following:
Figure 1. SQL query calculating average response time
TRAN     Task Cnt  Response Time Tot  Response Time Ave  
----  -----------  -----------------  -----------------  
APN8            3             2.1231             0.7077  
AP01           27             0.9987             0.0369  
AP02           42            10.3802             0.2471  
AP04            4             1.2992             0.3248  
CATA           19             0.5517             0.0290  
CATD           19             0.4133             0.0217  
CKBP         1297           148.2471             0.1143  
CMNE            2             1.3765             0.6882  
CMNK            2             0.5178             0.2589  
CMN1            2             0.4091             0.2045  
CMOB            8             2.7378             0.3422  

Information Information

Feedback


Timestamp icon Last updated: Thursday, 7 November 2013


http://pic.dhe.ibm.com/infocenter/cicsts/v5r1/topic//users-guide/cpaug324.htm