Unfortunately, I am at my wits end and having difficulty understanding the logic with DIV and MOD operators.
To recap, I need to process a file each day that can have varing numbers of records per account. I need to take that file, group by account number and add a unique sequence number to each group of records. This part I have gotten to work so far.
The second piece of the puzzle is I cannot have more than 7 records per each group. That being the case, I need to regroup and resequence the output. An example would be if acct# 12345 has 200 records, My first sequencing would only give me #1 for all 200 records. The second sequencing would give me sequence numbers 1-29 = 28 groups of 7 and 1 group of 4 (remainding accounts). Here is the code I have so far:
Any insight anyone can provide on how to solve this would be truly appreciated. Thanks again!!!