Fixed Length Flat File Processing - Need Validation

Hi, all,

I want to run this by all of you regarding my attempt to parse this flat file into an IS document via a flat file schema. Below is the flat file layout (each record has a record id as the first character);

MasterHeaderRecord: 80 bytes, 1 only
-BatchHeaderRecord: 80 bytes, 1 or multiple
–DetailRecord1: 80 bytes, 1 or multiple
–DetailRecord2: 80 bytes, 1 or multiple
-BatchTrailerRecord: 80 bytes, 1 or multiple
MasterTrailerRecord: 80 bytes

I built the ffs based on the above layout, but when validating the ffs, it gave me “found no record”. I was thinking about breaking this whole string into an array of strings, and then perform the rest of processing. Sort of wanting to take advantage of this ff package, if any one of you came across some creative ways of handling such nesting structure of flat files, pls advise. thanks a lot…

Sample data:
A00COMPANY111000000088801072414031111111111111111111111111TELESCOT00000008881111
B111111000112001072320010724SEBP90017743004TD1BANK111111111111110099999991811111
R0000010001000000020000000000000000000000605020411802111111111111111111111111111
2200107230004X9L5U1R1111111111111111111MS1BXXXXXXXXXXOANG11111111111111111111111
R00000200010000000146780000000000000000NW274200003201111111111111111111111111111
2200107230004J7K4I0R1111111111111111111MS1LXXXXXXXXXXU11111111111111111111111111
R0000030001000000013492000000000000000LMS409100015902111111111111111111111111111
2200107230004X7W2J1R1111111111111111111DONXXXXXXXXXXXLSON11111111111111111111111
Y1111110001000300000000000481701111111111111111111111111111111111111111111111111
B111111000212001072320010724SEBP90017743003ROYAL1DIRECT1111111110099999991811111
R00000100020000000181980000000000000000000LMS25050011111111111111111111111111111
220010723000306286111111111111111111111SUZXXXXXXXXXXXBELL11111111111111111111111
R00000200020000000150000000000000000000000LMS27680215111111111111111111111111111
220010723000300336111111111111111111111MOXXXXXXXXXXXELL1111111111111111111111111
Y1111110002000200000000000331981111111111111111111111111111111111111111111111111
B111111000312001072320010724SEBP90017743809BCCCU11111111111111110099999991811111
R00000100030000000093520000000000000000000LMS26120019111111111111111111111111111
2200107230809447450111111111111111111111BERXXXXXXXXXXXXXXXXXXXXAR111111111111111
Y1111110003000100000000000093521111111111111111111111111111111111111111111111111
X00COMPANY1110000000888000006000000907200000020111111111111111111111111111111111

The flat file parser should be able to handle this given a couple of things.

  1. Each type of record must have a unique identifier. Somewere in the record there has to be a record id that the parser can pick up on and it must be in the same place for each record.

  2. The NAME of the record in the flat file schema must match the unique id for the record.

So, guessing from your sample data I’d say that you have the following record id’s:

MasterHeaderRecord: A
-BatchHeaderRecord: B
–DetailRecord1: R
–DetailRecord2: 2
-BatchTrailerRecord: Y
MasterTrailerRecord: X

So you should have a record structure that looks like

A ( max repeat 1)

  • B (unlimited max repeat)
    – R ( unlimited max repeat )
    – 2 ( Unlimited max repeat )
    – Y (Unlimited max repeat )
  • X ( max repeat 1 )

Make sure that you have a fixed length parser that included the CRLF at the end of each record. So that if there’s 80 characters of data in a record and then a CRLF, the record length is 82. Then when definining the fields in the record you just don’t extract the last 2 characters.

Finally, if I’ve picked out the right record identifiers, you just need to make sure that the record identifier in the ffs is starts at 0.

Chris