# Schema question for a flat file parsing

**URL:** <https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [August 25, 2004, 8:53am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652 "2004-08-25T08:53:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 25, 2004, 8:53am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/1 "2004-08-25T08:53:54Z")

</div>

Hello all:  
Trying to get some direction on this:

I am having a problem creating schema for the following TICKET\_RECORD flat file:  
H 0 VALIDATION  
Travelwithm Vacations 082520042004000242  
Travelwitnm Vacations 082520042004000418248  
Travelwithm Vtions  
T 0 VALIDATION

* * *

## SCHEMA DEFNITION (added space in front of segment id for H and T records

\<SEGMENT ID="H "\>  
\<POSITION NAME=“RECORD\_TYPE” START=“0” LENGTH=“1”/\>  
\<POSITION NAME=“FILLER” START=“1” LENGTH=“12”/\>  
\<POSITION NAME=“SECURITY\_QUALIFIER” START=“13” LENGTH=“1”/\>  
\<POSITION NAME=“SECURITY\_PASSWORD” START=“14” LENGTH=“10”/\>  
\<POSITION NAME=“VENDOR\_ID” START=“24” LENGTH=“12”/\>  
\<POSITION NAME=“INTERCHANGE\_DATE” START=“36” LENGTH=“6”/\>  
\<POSITION NAME=“INTERCHANGE\_TIME” START=“42” LENGTH=“4”/\>  
\<POSITION NAME=“TRANSACTION\_SET\_TYPE” START=“46” LENGTH=“1”/\>  
\<POSITION NAME=“CONFIRMATIONS\_REQUESTED” START=“47” LENGTH=“1”/\>  
\<POSITION NAME=“TEST\_INDICATOR” START=“48” LENGTH=“1”/\>  
\<POSITION NAME=“NUMBER\_OF\_RECORDS” START=“49” LENGTH=“5”/\>  
\</SEGMENT\>  
\<SEGMENT ID=“recordWithNoID”\>  
\<POSITION NAME=“WHOLESALER\_NAME\_CHARACTER” START=“0” LENGTH=“50”/\>  
\<POSITION NAME=“ARRIVAL\_DATE” START=“50” LENGTH=“8”/\>  
\<POSITION NAME=“RESERVATION\_NUMBER” START=“58” LENGTH=“15”/\>  
\<POSITION NAME=“LAST\_NAME” START=“73” LENGTH=“15”/\>  
\<POSITION NAME=“FIRST\_NAME” START=“88” LENGTH=“15”/\>  
\<POSITION NAME=“TICKET\_CODE” START=“103” LENGTH=“5”/\>  
\<POSITION NAME=“TICKET\_DESCRIPTION” START=“108” LENGTH=“10”/\>  
\<POSITION NAME=“TICKET\_QUANTITY” START=“118” LENGTH=“3”/\>  
\<POSITION NAME=“TICKET\_COST” START=“121” LENGTH=“8”/\>  
\<POSITION NAME=“HOTEL\_CODE” START=“129” LENGTH=“30”/\>  
\</SEGMENT\>  
\<SEGMENT ID="T "\>  
\<POSITION NAME=“RECORD\_TYPE” START=“0” LENGTH=“1”/\>  
\<POSITION NAME=“FILLER” START=“1” LENGTH=“12”/\>  
\<POSITION NAME=“VENDOR\_ID” START=“13” LENGTH=“12”/\>  
\<POSITION NAME=“INTERCHANGE\_DATE” START=“25” LENGTH=“6”/\>  
\<POSITION NAME=“INTERCHANGE\_TIME” START=“31” LENGTH=“4”/\>  
\<POSITION NAME=“CONFIRMATIONS\_REQUESTED” START=“35” LENGTH=“1”/\>  
\<POSITION NAME=“TEST\_INDICATOR” START=“36” LENGTH=“1”/\>  
\<POSITION NAME=“NUMBER\_OF\_RECORDS” START=“37” LENGTH=“5”/\>  
\</SEGMENT\>  
\<SEG-ID\>H\</SEG-ID\>  
\<SEG-ID\>T\</SEG-ID\>  
\<LOOP Start=“recordWithNoID”\>  
\<SEG

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 25, 2004, 7:00pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/2 "2004-08-25T19:00:54Z")

</div>

Harsh,

Please don’t double post. Especially one such as detailed as yours.  
Have your tried setting skipWhiteSpace value to false in convertToValues. Just a thought as I’m unsure of the output.

---

<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:** [August 25, 2004, 7:05pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/3 "2004-08-25T19:05:55Z")

</div>

Chris,

As far i know Harsh is not using WmEDI/convertToValues, he is using some custom made service for parsing.

And i didnt mentioned in the other post of using the WmEDI services but no details posted about that by him.

May be he can try to attempt of using this service,if he has WmEDI module installed over there.

Harsh,please try to maintain the posts which you have created earlier.

Regards,

---

<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:** [August 25, 2004, 7:06pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/4 "2004-08-25T19:06:33Z")

</div>

Chris,

As far i know Harsh is not using WmEDI/convertToValues, he is using some custom made service for parsing.

And i did mentioned in the other post of using the WmEDI services but no details posted about that by him.

May be he can try to attempt of using this service,if he has WmEDI module installed over there.

Harsh,please try to maintain the posts which you have created earlier.

Regards,

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 25, 2004, 7:55pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/5 "2004-08-25T19:55:38Z")

</div>

Sorry about the double post Chris:  
I will try the skipWhiteSpace hint.

Hello RMG:  
Yes I am using the convertToValues service within:  
here is my flow:  
getTemplate  
convertToValues.

The problem comes in my record structure which has TICKET\_RECORD/H(space) or TICKET\_RECORD/T(space), the TICKET\_RECORD/recordwithNoID values are populated perfectly from the [ouput] of the convertToValues service, and this is because in my schema i had to put segment ID for H and T record with a space, to pull up the appropriate record from the flat file.

Appreciate the response, thanks

harsh

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 25, 2004, 8:12pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/6 "2004-08-25T20:12:55Z")

</div>

RMG: i am attaching my flow service and flat file with schema i am running thru this, i tried Chris, suggestion also but i still have the problem.

Thanks all!  
Harsh

![](http://www.wmusers.com/wmusers/icons/mime_txt.gif)Scema and flat files  
[schema\_flatfile.txt](http://www.wmusers.com/wmusers/messages/117/schema_flatfile-36858.txt) (5.9 k)

![](http://www.wmusers.com/wmusers/icons/mime_zip.gif)  
[test.zip](http://www.wmusers.com/wmusers/messages/117/test-36859.zip) (4.5 k)

---

<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:** [August 25, 2004, 8:36pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/7 "2004-08-25T20:36:49Z")

</div>

Harsh,

If you handling the problem with Space and recordWithNoID loop is working then what is the issue you have?

you mean when data is there in H/T records then it should overwrite the spaces right and still recordWithNoID loops should work.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 25, 2004, 8:52pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/8 "2004-08-25T20:52:49Z")

</div>

RMG,

I think the problem he’s having is with the BRANCH. The schema is fine but he can not BRANCH on "record/H " only on “record/H”.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 25, 2004, 9:10pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/9 "2004-08-25T21:10:29Z")

</div>

Hello Chris/RMG:  
Thanks for the reply, Yes the problem i am having is when i branch as i now have a space added in the [output] record . "record/H ". So i cannot proceed further. Is there somewhere i can avoid this space and still parse the file properly.  
regards and thanks

harsh

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 25, 2004, 9:46pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/10 "2004-08-25T21:46:32Z")

</div>

try trimming the recordid field to make it “record/H” and then BRANCH on it.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 25, 2004, 10:22pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/11 "2004-08-25T22:22:50Z")

</div>

Chris: can you explain in some detail on how i can do that.  
Thanks!

harsh

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 25, 2004, 10:56pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/12 "2004-08-25T22:56:02Z")

</div>

Use a map statement with trim as a transformer.  
record.recordId ---- trim — record.recordId  
should result in  
"H " —\> “H”  
Just map the record back to itself using trim in the transformer step.  
Then you should be able to BRANCH on record.recordId=“H”

HTH

---

<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:** [August 25, 2004, 11:29pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/13 "2004-08-25T23:29:18Z")

</div>

Harsh,

Chris sugesstion should resolve your problem.  
please try to implement the same way he mentioned.

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 26, 2004, 12:12am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/14 "2004-08-26T00:12:24Z")

</div>

Appreciate the response Chris/RMG but this still doesnt solve the problem:  
This is how my TICKET\_RECORD looks like:

converToValues[OUTPUT]–  
maps—\>  
TICKET\_RECORD  
|

- H\<space\>(HEADER record)  
-string values

- recordWithNoID (repeating record)  
-string values

- T\<space\>(TRAILER RECORD)  
-string values

The Header gets mapped from output into a H(space), i am not sure how i can use a trim , string transformer to trim a record.  
My branch is for values under H ( header) or T (trailer):  
TICKET\_RECORD/H

regrds,  
Harsh

---

<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:** [August 26, 2004, 12:32am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/15 "2004-08-26T00:32:36Z")

</div>

Can you use two different Branch steps one having with H(Space) and the other with no space and similarly for T Record.

Will this work for you?

sorry let me also think if anyother options.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [August 26, 2004, 12:35am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/16 "2004-08-26T00:35:33Z")

</div>

You’re correct but aren’t you BRANCHing on the field withing the record.  
ie. TICKET\_RECORD/H /field

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [August 26, 2004, 1:05am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/17 "2004-08-26T01:05:11Z")

</div>

RMG: In tried giving TICKET\_RECORD/H(SPACE), but this space is not persisted in developer and disappears when i save the change in the branch.

Chris i finally ended up using Record/H /field to go into the desired sequence.

Going back to the schema is there a more effcient way to tackle this, i.e records with no id’s having values similar to Header and Trailer segment id?.

Thanks all for your timely suggestions and ideas, i am going to the next level :-).

Harsh

---

<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:** [August 26, 2004, 3:08am UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/18 "2004-08-26T03:08:40Z")

</div>

This is also a good option using Record/H /field to go into the desired sequence.Anyways you got the resolution.

goodluck,

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [April 11, 2005, 12:08pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/19 "2005-04-11T12:08:51Z")

</div>

hi,

I am using convertToValues for a fixed length flat file.  
My input flat file has child records which can appear in any order.  
for example:

MainRecord…  
childrec1…  
childrec1…  
childrec2…  
childrec2…  
childrec1…  
childrec1…

i have set ordered=false in my schema. But in the output i am gettting 2 separate doc list for childrec1. I want a single separate doc lists for childrec1 and childrec2. Has anybody faced this problem. Please give me solution for this problem of mine.  
thanks,  
naka

---

<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:** [April 11, 2005, 7:02pm UTC](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652/20 "2005-04-11T19:02:27Z")

</div>

Noor,

Once you have parsed the flatfile you may have to map the seperated doclists what ever childrec1,childrec2 to another single doclists(childrec1),otherwise flatfile schema cannot handle this type of requirement since childrec1 is coming under childrec2.

May be there is easy way,let c if anyone have another clue to resolve.

HTH,  
RMG.

[Next page](https://techcommunity.softwareag.com/t/schema-question-for-a-flat-file-parsing/108652.md?page=2)
