Debatch flat file with header, 2 repeating records and trailer with tag identifiers

Tuan Nguyen 1 Reputation point
2021-07-09T02:34:41.677+00:00

Hello Friends

i have a flat file with header and trailers with Tag Identifiers as APTHDR and APTDTL respectively.

The current file has me miffed however, as it has a repeating record issue.
File Structure:

20data for the summary information 

APTHDR Header of record

APTDTL Detail of record

APTHDR Header of record

APTDTL Detail of record

20 trailler data

record 20 = one instance for summary, one instance for trailler
record APTHDR: one APTHDR have multiple APTDTL. one file have multiple APTHDR.

this is the data example:

20201117125512HH  001APPOINTMENT DATA                                    85372
APTHDR0350100000001 1 2CROS04202020-11-25012020-11-25 15:30:00.000000        PIC077120                   128027  2020-11-17 12:50:52.000265 N  N   0000004390000000000186000000                              00000                              PIC077120           023095412
APTDTL035010000000C116780360635000000439PIC077120           023095412
APTHDR0350100000001 1 2CACG05002020-11-25012020-11-25 14:00:00.000000        3501382191/,                183699  2020-11-17 12:51:02.000864 N  Y NS0000013210083300043754000000                              00000                              3501382191/, 1621476023035082
APTDTL035010000000C3100203821910000010013501382191/, 1621476023035082
APTDTL035010000000C3100202566840000001003501382191/, 1621476023035082
APTDTL035010000000C3100203826550000001073501382191/, 1621476023035082
APTDTL035010000000C3100203852630000000203501382191/, 1621476023035082
APTDTL035010000000C3100203746790000000183501382191/, 1621476023035082
APTDTL035010000000C3100202903510000000753501382191/, 1621476023035082
20201117125512TT  001000000000000000000110000000000

I get the results in the correct placement if I use a single set, but once I try to create a multiple record file it get hosed.
I just have no idea how to fix it.

Thanks!

Microsoft BizTalk Server
Microsoft BizTalk Server
A family of Microsoft server products that support large-scale implementation management of enterprise application integration processes.
363 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.