I’m having conceptual difficulty with building a data map. There are a variable number of “pages” and each page can have a variable number of “lines”.
The data is a text file. The first ten columns are an account number value, and I’ve set the Boundary when this value changes. So far so good.
Here is a little stump of the leftmost columns of the data file:
0000007326REM1*=============
0000007326REM * RA NUMBER #
0000007326REM * PAYMENT #
0000007326REM *
0000007326REM * PAYEE NAME:
0000007326REM *
0000007326REM2*=============
0000007326REM * RA NUMBER #
0000007327REM1*=============
0000007327REM * RA NUMBER #
0000007327REM * PAYMENT #
0000007327REM *
So when 7326 becomes 7327, that’s a new record. That part I can do.
But then I need to extract all the lines for page “1”, which is 6 lines in this sample. I can do that, into a detail table, looking at that column and looping until it isn’t empty. Then loop through page “2”, which in this sample is just 2 lines. A new detail table.
What I cannot figure out is how to make this open ended. I need to loop through the entire record, extracting lines into a detail table, until a new “page” is reached, at that point I need to create a new detail table and loop until finished.
I can do the inner loop, but how do I construct the outer loop so that I can have a variable number of “pages”, one detail table per page?
What I’d expect from the data sample above is 2 records (7326 and 7327).
Record 7326 would have two detail tables, the first with 6 lines, the next with 2 lines.
Record 7327 would have a single detail table, with 4 lines.
Is this possible?