How do I get different record type into 1 dataset??
Moderators: chulett, rschirm, roy
How do I get different record type into 1 dataset??
I am creating multiple record types in my transformations. Each record is 256 bytes in size with only the 1st 2 fields are the same on each record. How do I go about getting them into 1 sequential file???
Header Record - HDR000000112012009xxxxxxbbbbbbanbu wrote:Can you provide sample input and expected output?
Detail Record - DTL0000002aaaaa123456zzzzzzzzzz
Trailer Record - TRL0000003x1x1x1x1x1x1x1x1x1x1
Expected result on final file
HDR000000112012009xxxxxxbbbbbb
DTL0000002aaaaa123456zzzzzzzzzz
TRL0000003x1x1x1x1x1x1x1x1x1x1
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A Data Set may have only one record schema.
However, you can use subrecords to store variant formats in a Data Set. The penalty is that you have to create and later parse the subrecords.
However, you can use subrecords to store variant formats in a Data Set. The penalty is that you have to create and later parse the subrecords.
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.
-
- Participant
- Posts: 437
- Joined: Fri Oct 21, 2005 10:00 pm
Your topic says that you want multiple layouts in a dataset, yet your post says that you want multiple layouts in a sequential file - that makes this thread a little confusing.
I'm assuming sequential file, from your transformer you should have three links coming out (if you need them in a particular order in the file you should create an extra column with a number associated with the oder for instance dummy column with value of 1 for header, 2 for detail and 3 for trailer). Use a column export to collapse all of the columns except for dummy into a single column. Then funnel (use a sorted funnel with dummy as your key) and write to a data set.
I'm assuming sequential file, from your transformer you should have three links coming out (if you need them in a particular order in the file you should create an extra column with a number associated with the oder for instance dummy column with value of 1 for header, 2 for detail and 3 for trailer). Use a column export to collapse all of the columns except for dummy into a single column. Then funnel (use a sorted funnel with dummy as your key) and write to a data set.
Keith Williams
keith@peacefieldinc.com
keith@peacefieldinc.com
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
In either a sequential file or a data set you could use a record schema that contains three fields, field1, field2 and "the rest" (as a VarChar), at the expense of some parsing.
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.