Hi,
You sort the records in a way that all the sales people are together.
In your program you consider a group of records with the same salesman-identifier.
But, if the idea is not to sort, you can use a table to add the sales for each salesman. Because there are only 20 of them, it will fit in a working-storage table.
something like:
01 SALES-PEOPLE.
03 SALESMAN OCCURS 20.
05 SALESMAN-IDENTIFIER PIC X(10).
05 SALESMAN-SALES PIC S9(11)V99 COMP.
You initialize the table. During the processing you look up if the salesman-identifier exists in the table. If not, you add it. You also add the sales to salesman-sales for each record you process.
I hope this helps.