Hmmm ... this is a tough one. The DFSORT job below will get you the two parts of the report as two different output files, but I can't figure out how to stitch them together the way you want them. You could, of course, copy and paste.
My input files is :
First 2 bytes - Region code
Next 2 bytes - Branch code
Then, Data starts for each record.
In the same region different branches can be present but vice versa is not true. There can be more than one record for each branch in the input file, but data will be different in all these records although they are from the same branch.
The input file is sorted on region and then on branch.
For every brach change, i need a report and for every region change i need a report.
Please let me know if you need additional information from me.