I was wondering whether the following could be accomplished by using DFSORT instead of writing a program.
Thanks in advance.
Input information (ordered by product)
Product Quantity Price Gross
----------------------------------------------------
PRO1 180 7.62 1371.60
PRO1 12 7.62 91.44
PRO1 110 7.61 837.10
PRO1 220 7.65 1683.00
Format of expected input information:
PRO1001800007620137160
PRO1000120007620009144
PRO1001100007610083710
PRO1002200007650168300
PRO1000120007620009144
PRO1001100007610083710
PRO1002200007650168300
Output information:
Product Quantity Avg.Price Gross
---------------------------------------------------------
PRO1 522 7.63 3983.14
Desired format of output information:
PRO1005220007630398314
That is, for each given product (in the example only PRO1), obtain the total quantity, and also the total gross (with its corresponding price), and the average price.