Here is a possible solution.
#1 Schedule a job to run for every 15 min.
#2 Have a COBOL program to execute the following query using fetch.
SELECT PRODUCT-ID, DEPT, SUM(QTY) FROM TABLE_1 GROUP BY PRODUCT-ID, DEPT
#3 Have a count file to note the number of run. For the first run this file will have 1 and for second run it will have 2 and so on.
#4 Have your required O/P file as a VSAM file with Key as PRODUCT-ID and DEPT. Also have the field METRIC in a array with occurance of 96.Daily this file will be del/def.
#5 Update the VSAM file with the same COBOL program each time and for the METRIC field use the count from count file as a subscript.
Post if you do not understand any of my above point.