Page 1 of 1

File with diff record layouts

Posted: Wed May 16, 2007 2:51 pm
by Shree0410
Hi,
I have a file with different record layouts.

example -
record 1 is of 7 columns
record 2 is of 4 columns(not all columns are same as of record 1)
record 3 is of 6 columns(not all columns are same as of record 1 and record 2)


and the same above set of records repeat. How can I use this file as input in a DataStage job with different record layouts.

Thanks

Posted: Wed May 16, 2007 4:02 pm
by ray.wurlod
Read all records as one column (VarChar).
Use Transformer stage to identify record type (even by counting the number of delimiters) and direct rows to the appropriate output, parsing into the correct number of columns using the Field() function.