# Flat file parsing of irregular records

**URL:** <https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [November 28, 2006, 8:25pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154 "2006-11-28T20:25:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitgupta905](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@amitgupta905](https://techcommunity.softwareag.com/u/amitgupta905)\
**Post date:** [November 28, 2006, 8:25pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/1 "2006-11-28T20:25:59Z")

</div>

Hello,

I have a issue regarding flat file parsing. I have flat file with fixed length records.  
HXXXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
TXXXXXXXXXXXXXXX

where H, D , 83 , T are record identifiers. D and 83 records occur in irregular fashion. I want to get all the D and 83 records in 1 list item for each D and 83.

while right now i am gettin as per above data :  
3 list items for D , and 2 list items for 83 records.

Please help me what should i modify in my curent template so that it parses correctly.  
attached is my current template.

please help me… its urgent…

You kind help would be more than appreciated.

Thanks a lot…!!!  
Regards,  
Amit  
[Template.txt](https://techcommunity.softwareag.com/uploads/short-url/9wJMhgRlN33zi5prZagVUvGF0xN.txt) (4.85 KB)

---

<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:** [November 28, 2006, 8:49pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/2 "2006-11-28T20:49:13Z")

</div>

What you have to do it change your schema in this fashion.

(RecordIdentifier)  
D (maxRepeat=unlimited)  
 → D FieldDefinitions  
–\>83 (maxRepeat=unlimited) put this 83 record definition in the same D hierarchy  
----\>83 Field Definitions

This way D and 83 RecordDefinitions will loop together and test the FF parsing you should see the expected results.

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![amitgupta905](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@amitgupta905](https://techcommunity.softwareag.com/u/amitgupta905)\
**Post date:** [November 28, 2006, 9:07pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/3 "2006-11-28T21:07:27Z")

</div>

Hi RMG,

Thanks for your prompt response.  
I am working on SAP BC 4.0 version. i have attahed the template.  
If you could please help me by editing the template.

I dont know how to introduce max repeats in this template.  
Or if you have any guidelines for that ( any pdf document ).

Also D and 83 records are in same level.

Thanks a lot…  
Amit

---

<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:** [November 28, 2006, 10:14pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/4 "2006-11-28T22:14:27Z")

</div>

Oh 4.6…i thought you are using wM IS6.x FlatFile Adapter Schema capabilities.

So in your template at the end set this and

D1 8395

Finally generate your updated Schema/record for this template change.

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![amitgupta905](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@amitgupta905](https://techcommunity.softwareag.com/u/amitgupta905)\
**Post date:** [November 28, 2006, 10:30pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/5 "2006-11-28T22:30:23Z")

</div>

Hi RMG,  
Thanx for your suggestion.  
I have already tried this.  
This doesnot work. when we do this… it all the D1 records in one but subsequent 8395 records come as sub part of D1. Like for the data

HXXXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
83XXXXXXXXXXXXXX  
DXXXXXXXXXXXXXXX  
TXXXXXXXXXXXXXXX

I will get 1list for D records  
D  
-D[0]  
-D[1]  
-83[0]  
-83[1]  
-83[2]  
-D[2]  
-83[0]  
-D[3]

I want the output as  
D  
-D[0]  
-D[1]  
-D[2]  
-D[3]  
83  
-83[0]  
-83[1]  
-83[2]  
-83[3]

Please suggest me some thing.

Thanks a lot…

Regards,  
Amit

---

<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:** [November 28, 2006, 11:28pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/6 "2006-11-28T23:28:02Z")

</div>

You should get like this only

You should get this order only, since D and 83 are repeating together based on your sample file…FF parsing cannot seperate it with D and 83 as individual records.

D  
-D[0]  
-D[1]  
-83[0]  
-83[1]  
-83[2]  
-D[2]  
-83[0]  
-D[3]

HTH,  
RMG

---

<div class="post-metadata">

**Author:** ![amitgupta905](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@amitgupta905](https://techcommunity.softwareag.com/u/amitgupta905)\
**Post date:** [November 28, 2006, 11:33pm UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/7 "2006-11-28T23:33:23Z")

</div>

Hi RMG,

Now if i want that kind of out put how shud i go ?? shall i loop on D records and transfer 83 records into a temp one , then accumulate them…and then go ahead. Is that feasible ???

else any suggestions… ?

Really appreciate for your time and help.

Regards,  
Amit

---

<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:** [November 29, 2006, 1:32am UTC](https://techcommunity.softwareag.com/t/flat-file-parsing-of-irregular-records/109154/8 "2006-11-29T01:32:27Z")

</div>

“shall i loop on D records and transfer 83 records into a temp one , then accumulate them”

Yes If you wanted them seperately processed then go with this divide approach but make a note this will kill your service performance.

But based on your sample ff layout D and 83 structures should loop together and your parsing/transformation will be success.If this works then What is the show stopper in your flow?? You can use the same structure and map it to your target format.

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-parsing-of-irregular-records/109154/9 "2021-04-02T15:05:33Z")

</div>


