Originally posted by: SystemAdmin
Type Tree issue....
This pretty much a fundamental question in which I found a resolution, but it would really be helpful for me to understand this, because I've hit it so many times. .
I have an input file that contains a main loop, which contains a Header, and a number of detail records. I want to split all the main loops and put them into there own file, so rather then define each of the records (D010, D020,D030, etc) I did it generically.
File:
MainLoop(s)
Header initiator = "H001"
RecordLoop (s)
H010Record Initiator = "H010"
GenericRecords(s)
H001
H010
D50
D50
H001 <-----Second Main loop
H010
D50
D50
Basically when the file is read, it find the first Header, then it find the H010 record, and I need for it to NOT read the second "H001" as a "Generic Record". So what I do is put a component rule on it; LEFT($,4)!="H001".
When it hits the second main loop (H001 records), it fails the component rules test, which is what I was hoping for, but rather then figure that it's the end of the first loop and it should see the data as the start of a new Main loop, it doesn't. It just figures there's an error in the data and gives me a "One or more inputs are invalid".
I know it's kind of an oddball-ish type question, and the answer will be something like "this is just the way the engine works", but can anyone explain why it doesn't do what I want it to?
Luckily, all the detail records start with a "D", so I put "D" as an initiator for the "Generic Records", and I'm getting the results I want.
But that's the weird thing. If I say the generic records have to start with D, it works, but if I say "it can't start with "H001", it doesn't.
Thanks!
(Level 4: Offset 9387, len 91, comp 1 of 1, #1, DI 00000045:)
Data at offset 9387 ('H001ZZUSPSSME ') was found to be of TYPE
X'0009' (GenBlob DATA).
(Level 4: Offset 9387, len 91, comp 1 of 1, #1, DI 00000046:)
Data at offset 9387 ('H001ZZUSPSSME ...') failed COMPONENT RULE test
for component number 1, TYPE X'0008' (GenericRecs DATA).
(Level 3: Offset 9387, len 91, comp 2 of 2, #33, DI 00000046:)
Data at offset 9387 ('H001ZZUSPSSME ') is INVALID data of TYPE
X'0008' (GenericRecs DATA).
#DataExchange#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender