Define a WORKING-STORAGE variable to hold the current branch id. Open the files, read the first record, set the count to one, move the branch id to the hold variable. Then loop until end of file: read the file, compare the branch id to the held branch id. If they are the same, add 1 to the count. If they are not the same, write a report line with the branch id and the count, move the read branch id to the hold branch variable, set the count back to 1.
When you're through with the loop, you'll need to write out the last branch id and count, close the files, then you're don.