If the data is already sorted, account for that in a ctlnCNTL file.
It can equally be done with PGM=SORT. As expat says, SORT on your fields and SUM FIELDS=NONE if the data needs sorting. If the data is already sorted, you can use MERGE with just SORTIN01 and SUM FIELDS=NONE.
For can also look at the reporting features of OUTFIL.