OL Learn

Detail Data with Summary Record

I have text detail data that is comprised of one or more detail data lines followed by a summary record:

detail
summary
detail
detail
detail
summary
detail
detail
summary

What would be the best way to handle this in the data mapper?

If this is a text file, set it to read 1 line/record at a time.

In the Boundary section, set the boundary on presence of the text “summary” (at least for the example you posted, this would work).

Then to extract your data, begin with a loop that runs “Until…” you see the text “summary”. Extract your details lines into a detail table inside the loop.

When the loop completes, you can add another extraction outside the bottom of the loop that extracts the summary line; set the Top Offset to “0” to pick up the summary line as that’s the line (current line) the loop will leave you on.