Example: For an inventory list, a company requires a single record for each product, indicating its item number, warehouse code, and the total quantity in stock. (The figure Input Record Layout gives the sample record layout.)
To combine those inventory records with identical item numbers and warehouse codes and to produce the required list, the following is coded.
Explanation: The list is generated by sorting on the Warehouse Code field (6,1,CH) and the Item Number field (1,5,ZD). Records that have identical information in both these fields are combined into a single record that contains the sum or total of those records’ Quantity fields (7,12,PD). That is, the single record will show how many items with the same number are in each warehouse.