# Flatfile with multiple record types

**URL:** <https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [May 26, 2006, 9:33pm UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873 "2006-05-26T21:33:31Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 26, 2006, 9:33pm UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/1 "2006-05-26T21:33:31Z")

</div>

I create a FF dictionary and schema to read a flatfile with multiple record types in fixed format (255 characters). My test flatfile has only 2 records and 2 record types for now (Initial and Trailer type). When I run the FF schema, it returns [FFP.0011.0016] - Element has nested errors, and child errors [FFP.0011.0001] Missing mandatory elements. Any suggestions or advice are very much appreciated.

Thanks, vldoran

---

<div class="post-metadata">

**Author:** ![cjcable](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cjcable](https://techcommunity.softwareag.com/u/cjcable)\
**Post date:** [May 26, 2006, 10:52pm UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/2 "2006-05-26T22:52:16Z")

</div>

How many different record types do you have defined in your schema? There is a field called “Mandatory” if set to true requires that the record type is found in the file. Could that be your problem?

-Cort

---

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 26, 2006, 11:09pm UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/3 "2006-05-26T23:09:23Z")

</div>

I defined 2 record types in my schema ‘Initial’ and ‘Trailer’. Input file has 2 fixed-length 255-bytes records, 1 for ‘Initial’ and 9 for ‘Trailer’. WM read the 2 records as ‘Initial’. I expect it read the first one for Initial and the second one as ‘Trailer’. It does not matter if mandatory is set to True or False. My input file looks like this:

1ADPE 200605181402  
9000000200000000000000

Regards, Van-Loc

---

<div class="post-metadata">

**Author:** ![cjcable](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cjcable](https://techcommunity.softwareag.com/u/cjcable)\
**Post date:** [May 27, 2006, 12:27am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/4 "2006-05-27T00:27:45Z")

</div>

Have you tried selecting the “Delimiter” as your Record Parser and “newline” as your Record separator?

I have done this is in the past and still able to pick up multiple header/trailer records in a fixed length ff.

HTH

---

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 27, 2006, 12:50am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/5 "2006-05-27T00:50:18Z")

</div>

Yes, I did. Currently, my FF schema reads both input records using only the ‘Initial’ identifier. I don’t know it does not read it does not parse the second record using the ‘Trailer’ identifier.

Thanks, vldoran.

---

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 27, 2006, 12:58am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/6 "2006-05-27T00:58:39Z")

</div>

How do you define your FF dictionary for multiple record types? Under Record Definition, I created 2 record definitions, 1 for Initial and 1 for Trailer, then the fields are created under Initial and Trailer. I’m not sure if this is correct.

Thanks, vldoran.

---

<div class="post-metadata">

**Author:** ![cjcable](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cjcable](https://techcommunity.softwareag.com/u/cjcable)\
**Post date:** [May 27, 2006, 1:08am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/7 "2006-05-27T01:08:19Z")

</div>

That is how I have successfully done it before.

How about your schema, did you reference those record definitions from the dictionary and change the name to the record types “1” , “9” ?

---

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 27, 2006, 1:15am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/8 "2006-05-27T01:15:41Z")

</div>

Yes. I just got it! Thanks for your help.  
vldoran

---

<div class="post-metadata">

**Author:** ![cjcable](https://avatars.discourse-cdn.com/v4/letter/c/d6d6ee/32.png) [@cjcable](https://techcommunity.softwareag.com/u/cjcable)\
**Post date:** [May 27, 2006, 1:18am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/9 "2006-05-27T01:18:09Z")

</div>

No problem. Do you mind sharing the solution?

---

<div class="post-metadata">

**Author:** ![VanLoc\_Doran](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/vanloc_doran/32/713_2.png) [@VanLoc\_Doran](https://techcommunity.softwareag.com/u/VanLoc_Doran)\
**Post date:** [May 27, 2006, 1:27am UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/10 "2006-05-27T01:27:51Z")

</div>

The same way you had suggested. When I re-created the record definition in my FF schema, I noticed the lengthy explanation about naming the record definition. I should have read it more carefully (duh!). It’s very nice to get many responses through this forum. Thank you and have a good holiday weekend.

vldoran

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:05pm UTC](https://techcommunity.softwareag.com/t/flatfile-with-multiple-record-types/108873/11 "2021-04-02T15:05:25Z")

</div>


