To be specific on your issue, I would need to see your type tree, input and potentially the map. Your RecTypes need to be mutually exclusive.
So if I am interpreting correctly your type tree should have a "transaction" group in a File Group that repeats (s) or 1:s, Transaction should have 4 main sub-group record types: Header 1:1, Terms 0:5, Detail 1:s?, Install 0:1. Within the DetailLoop Record Group there is the Detail 0:1 record, ShipNo s, Serial s, FeatureLoop 1:s? and within the FeatureLoop there is Feature 0:1, Feasure s, Feaship 0:1.
Are all records delimited with the same delimiter or are some of these fields and not records or a composite "field" within a record like X12? My first reaction is that you have very little way to distinguish a DetailLoop because all components are optional. Is this really the data? It seems that at least one item within the detail loop should be required to make it a detail loop and identifiable. Is the initiator present even if the data is not? Are records padded to a specific length?
Do you have access to the X12 tree? Look at the way they do it and extrapolate for your situation - though if it is positional many of your record definitions will be explicit instead of implicit.
You can upload files to this platform. Maybe you can de-identify a sample record and attach with your type tree?
Happy mapping!
------------------------------
Lisa Edwards
Software Engineer / Subject Matter Expert
Rainbow Data Systems, Inc
------------------------------
Original Message:
Sent: Wed June 11, 2025 02:24 PM
From: Sirisha Mudumbai
Subject: Reading input file incorrectly.
Hi
I am trying to translate Flat file to X12 format.
My input flat file format has following records.
HEADER (1:1)
TERMS (0:5)
DETAILLOOP
DETAIL(0:1)
SHIPNO(S)
SERIAL(S)
FEATURE LOOP
FEATURE(0:1)
FEASER(S)
FEASHIP(0:1)
INSTALL(0:1)
Each record starts with a rec-type field. It is defaulted with different record types. Also added a component rule at each rec-type field. But When I try to run my input file its failing as it is reading DETAIL record also as TERMS record as I have defined (0:5) it is expecting 5 TERMS records.
My Input looks something like this:
HEADER...
TERMS ....
DETAIL...
INSTALL
HEADER...
DETAIL..
FEATUR..
INSTALL....
I have tried with initiators instead of rec-type fields then My Input is being read properly but writing to error record in case of invalid rec-type is not working.
Any help would be appreciated.
Thanks in advance!!
------------------------------
Sirisha Mudumbai
------------------------------