Sometimes you may want to shorten a file by consolidating records that have some information in common. For example, a company’s invoice file may contain more than one record for any customer to whom multiple invoices have been issued. In some applications it might then be feasible to consolidate such records – that is, to combine records with identical Customer Name and Address fields into a single record containing the sum of that customer’s charges and payments.
The SUM control statement allows you to combine records in this way. For SUM control statement syntax, see SUM Control Statement.