How do I get different record type into 1 dataset??

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mstaton
Participant
Posts: 5
Joined: Fri Jul 16, 2010 5:10 am

How do I get different record type into 1 dataset??

Post by mstaton »

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???
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Can you provide sample input and expected output?
You are the creator of your destiny - Swami Vivekananda
mstaton
Participant
Posts: 5
Joined: Fri Jul 16, 2010 5:10 am

Post by mstaton »

anbu wrote:Can you provide sample input and expected output?
Header Record - HDR000000112012009xxxxxxbbbbbb
Detail Record - DTL0000002aaaaa123456zzzzzzzzzz
Trailer Record - TRL0000003x1x1x1x1x1x1x1x1x1x1

Expected result on final file

HDR000000112012009xxxxxxbbbbbb
DTL0000002aaaaa123456zzzzzzzzzz
TRL0000003x1x1x1x1x1x1x1x1x1x1
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Your input and output looks identical. So what are you doing with transformations?

Are the different records comes in different input files?
You are the creator of your destiny - Swami Vivekananda
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Post by kwwilliams »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
Post Reply