# Flat file without record identifier and have hierarchy

**URL:** <https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [July 20, 2007, 3:47pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328 "2007-07-20T15:47:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mukesh\_Sharma](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Mukesh\_Sharma](https://techcommunity.softwareag.com/u/Mukesh_Sharma)\
**Post date:** [July 20, 2007, 3:47pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/1 "2007-07-20T15:47:01Z")

</div>

I’m using WM 6.1 and my input flat file is like

921577234332|11261385142|20070703|11|20070423  
001|US|MOD,RF UPCNVRTR,BOT|9030908840|000000000  
002| |MOD-RF UPCNVRTR,TOP|9030908840|00000000020 000000010.51||0.000000|000000010.51  
AGILENT TECHNOLOGIES INC|LIBERTY LAKE WA  
AGILENT TECHNOLOGIES INC

Header  
|\_ Items,Totals,Exporter,Importer

The flat file is without the record identifier,I know I can use recorWithNoID or default recrod but that is true when you have only one record with the default structure but here the structure is different for every line.

Thanks for any suggestions

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 20, 2007, 6:17pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/2 "2007-07-20T18:17:35Z")

</div>

When you define the RecordDefinition “recordWithNoID” in the properties area (set maxRepeat = unlimited instead of single) this will take care incase of single or multiple records both conditions.

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![Mukesh\_Sharma](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Mukesh\_Sharma](https://techcommunity.softwareag.com/u/Mukesh_Sharma)\
**Post date:** [July 20, 2007, 6:29pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/3 "2007-07-20T18:29:01Z")

</div>

thanks RMG  
but the record structure is different for every line  
in the default record I can just provide the record structure for one line

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 20, 2007, 7:12pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/4 "2007-07-20T19:12:58Z")

</div>

I am still not clear what your record structure look like.If you dont have record identifier use recordWithNoID and as you said some records has the name then under the recordWithNoID hierarchy create another record definition with record names etc…

for example your record structure can be like this:  
recordWithNoID (Header) max repeat = single or unlimited  
—\>lines (Lineitems) - max repeat = unlimited  
—\>Summary (Trailer) max repeate = single

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![Mukesh\_Sharma](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@Mukesh\_Sharma](https://techcommunity.softwareag.com/u/Mukesh_Sharma)\
**Post date:** [July 20, 2007, 7:20pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/5 "2007-07-20T19:20:58Z")

</div>

Hi RMG  
Actually none of the records are having record identifier,this is the structure of one set of record,it wiil repeat in the similar fashion

921577234332|11261385142|20070703|11|20070423  
001|US|MOD,RF UPCNVRTR,BOT|9030908840|000000000  
002| |MOD-RF UPCNVRTR,TOP|9030908840|00000000020 000000010.51||0.000000|000000010.51  
AGILENT TECHNOLOGIES INC|LIBERTY LAKE WA  
AGILENT TECHNOLOGIES INC

so if i put the first record structure under recordWithNoID  
how do I arrange the other following as they are also not having Record identifier.

Thanks for your valuable inputs

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [July 20, 2007, 7:23pm UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/6 "2007-07-20T19:23:53Z")

</div>

OK as i told above set recordWithNoID (max Repeat = unlimited) and create FFSchema/DocumentType then based on your file format above while parsing the each line will be under the recordWithNoID record set (DocumentList) and then you map it accordingly.This is the only way you have.

HTH,  
RMg

---

<div class="post-metadata">

**Author:** ![vijayvjp](https://avatars.discourse-cdn.com/v4/letter/v/77aa72/32.png) [@vijayvjp](https://techcommunity.softwareag.com/u/vijayvjp)\
**Post date:** [February 5, 2009, 3:37am UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/7 "2009-02-05T03:37:36Z")

</div>

Hello,  
I am creating NACHA file by receiving input in an XML format.  
If I create FlatFile schema with record ids then I have to name the record fields as 1, 5, 6, 7,8,9 see below  
1 (FileHeader) max repeat = single  
—\>5 (BatchHeader) - max repeat = unlimited  
—\>—\>6 (Entry) max repeate = unlimited  
—\>—\>—\>7 (Addenda) max repeate = unlimited  
—\>8 (BatchTrailer) - max repeat = unlimited  
9 (FileTrailer) max repeat = single

But when I try to create XML which confirms to document type associated with abouve schema. system does not allow because the xml nodes can not be numeric values like 1, 5,6 etc.

So I wanted to create schema contaning recordWithNoID records.  
recordWithNoID (1 FileHeader) max repeat = single  
—\>recordWithNoID (5 BatchHeader) - max repeat = unlimited  
—\>—\>recordWithNoID (6 Entry) max repeate = unlimited  
—\>—\>—\>recordWithNoID (7 Addenda) max repeate = unlimited  
—\>recordWithNoID (8 BatchTrailer) - max repeat = unlimited  
recordWithNoID (9 FileTrailer) max repeat = single

when I use the above recordWithNoID schema and convertToString then Records 8 (BatchTrailer) and 9 (FileTrailer) does not get created. Is there a way to achieve this?

I was trying to find what is the reason for not generating Records 8 (BatchTrailer) and 9 (FileTrailer)  
recWithNoIDLike46 = false (default) Determines how the pub.flatFile:convertToValues service handles recordWithNoID records.  
false (the default): Each recordWithNoID record appears as a child of the record above it, in an array.

So in case of recordWithNoID NACHA schema 8 is not child of preceding node 7 and 9 is not child of preceding node 8. Is my conclusion right?

---

<div class="post-metadata">

**Author:** ![gupta\_r.17495](https://avatars.discourse-cdn.com/v4/letter/g/9fc348/32.png) [@gupta\_r.17495](https://techcommunity.softwareag.com/u/gupta_r.17495)\
**Post date:** [February 5, 2009, 4:37am UTC](https://techcommunity.softwareag.com/t/flat-file-without-record-identifier-and-have-hierarchy/109328/8 "2009-02-05T04:37:56Z")

</div>

May be its something to do with the Hierarchy of 8,9 you have in place…

So can you try with this layout levels:

recordWithNoID (1 FileHeader) max repeat = single  
—\>recordWithNoID (5 BatchHeader) - max repeat = unlimited  
----\>—\>recordWithNoID (6 Entry) max repeat = unlimited  
—\>—\>—\>recordWithNoID (7 Addenda) max repeat = unlimited  
----------- \>recordWithNoID (8 BatchTrailer) - max repeat = unlimited  
—\>recordWithNoID (9 FileTrailer) max repeat = single

If the above doesn’t work then shift/move record 8 under the record 7 level more deeper…

You got to play with the hierarchy until it mathces with your flatfile data sample.

HTH  
RMG

---

<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/flat-file-without-record-identifier-and-have-hierarchy/109328/9 "2021-04-02T15:05:38Z")

</div>


