Hi All,
We need to extract data from sequential file which has 3(kinds of data)
set of records
the format of the source file is
1)HEADER
2)RECORDS
3)TRAILER
is there any method to seperate these three
sets of
records or is there any method to count the number rows in a sequential file.
Extract from sequential file
Moderators: chulett, rschirm, roy
Re: Extract from sequential file
Is the structure of your header and trailer different from the records? If so, then that could be used to separate them from the records. Regarding counting the records, a simple way would be to append a new column to the output (via a transformer) and use @INROWNUM as its derivation. If the first record is always the header and the last record, the trailer, then you can use a second transformer to split the header and trailer from the records, based on the row number.
gateleys
gateleys
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Read the file as a single column, or perhaps two if the record type designator is at the beginning of each line. Use the value of the record type designator to constrain three outputs from a Transformer stage (header, detail, trailer). Parse the single column of data into appropriate fields on these outputs.
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.