Hi
I need to flatten a mainframe like text file. There are 3 record types:
Header (1st byte is an 'A')
Segment (1st byte is a '$')
Detail (1st byte is numeric)
Input
Axxxxxxx
$yyyyyyy
01detaaa
02detbbb
03detccc
Azzzzzzz
$jjjjjjj
01detddd
Desired Output
Axxxxxxx$yyyyyyy01detaaa
Axxxxxxx$yyyyyyy02detbbb
Axxxxxxx$yyyyyyy03detccc
Azzzzzzz$jjjjjjj01detddd
Any Suggestions?
Thanks,
Joan
Flattening a multi record type text file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
First byte or first character?
Either way, I'd read this as a single VarChar field and do the parsing and flattening in a Transformer stage. Use stage variables to preserve, and detect changes in, the header and segment records.
Either way, I'd read this as a single VarChar field and do the parsing and flattening in a Transformer stage. Use stage variables to preserve, and detect changes in, the header and segment records.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.