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
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.
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.
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
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”
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
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 :-).
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
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.