Multiple recordtypes in a single flatfile
Moderators: chulett, rschirm, roy
Multiple recordtypes in a single flatfile
Hi all,
I have a sequentialfile as input that has two recordtypes.
The two recordtypes are of a completly different layout.
I have a table definition for both recordtypes. Can I use those to write the contents of the file to two database tables?
thanks in advance,
Victor
I have a sequentialfile as input that has two recordtypes.
The two recordtypes are of a completly different layout.
I have a table definition for both recordtypes. Can I use those to write the contents of the file to two database tables?
thanks in advance,
Victor
Victorbos,
you can define your original file read in any column definition form as long as you can check your indicator field in a transform; I usually define the whole row as just one column if possible. Then, instead of having to parse out all of your columns, just write the data back to a file (I usually will use a pipe here to save I/O time) and read from that file using the correct column definitions. It is easy to do and also quite efficient.
you can define your original file read in any column definition form as long as you can check your indicator field in a transform; I usually define the whole row as just one column if possible. Then, instead of having to parse out all of your columns, just write the data back to a file (I usually will use a pipe here to save I/O time) and read from that file using the correct column definitions. It is easy to do and also quite efficient.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 483
- Joined: Thu Jun 12, 2003 4:47 pm
- Location: St. Louis, Missouri USA
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
You can also use the Complex File Stage with multiple output links - the selection page allows you to define the field as the rectype indicator and each output link can have different table defs on it
Its a more elegant, and understandable solution but I am not sure about performance vs reading from a seqstage - but these things are often a balance.
Ed
Its a more elegant, and understandable solution but I am not sure about performance vs reading from a seqstage - but these things are often a balance.
Ed