I have one text file with 3 different layouts.
content of the file:
the first 5 lines contain header information (layout 1)
line 6 to 20 contains detail record information (layout 2)
line 21 to the end contain trailer information. (layout 3)
how can I read all three formats from the same sequential file?
I want to
read layout 1 and output to dataset 1,
read layout 2 and output to dataset 2,
read layout 3 and output to dataset3.
Can I do that in one job, and avoid all the warnings.
how can I read all three formats from the same sequential fi
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Parallel job (as marked) or server job (as posted)?
Probably the easiest way to do this is to read the file using a single field (data type VarChar) with a Transformer stage executing in sequential mode.
The Transformer stage has three outputs with constraints based on the system variable @INROWNUM.
Parse appropriately using Field() functions or substring (for fixed-width data).
Probably the easiest way to do this is to read the file using a single field (data type VarChar) with a Transformer stage executing in sequential mode.
The Transformer stage has three outputs with constraints based on the system variable @INROWNUM.
Code: Select all
@INROWNUM <= 5
@INROWNUM >= 6 AND @INROWNUM <= 20
@INROWNUM >= 21
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.