Reading file with multiple header and trailer

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
wahi80
Participant
Posts: 214
Joined: Thu Feb 07, 2008 4:37 pm

Reading file with multiple header and trailer

Post by wahi80 »

Hi,

I have an input file which has following format

Code: Select all

Header1
Det Records1 (Width 80)
Trailer1
Header2
Det Records2 (Width 80)
Trailer2
Header3
Det Records3 (Width 80)
Trailer3
All detail records are width 80,but within each set there are different coulmn widths

e.g Det Record1 can have 4 coulmns, whereas DEt Record2 can have 8 columns

How do I read this file?

Regards
Wah
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Re: Reading file with multiple header and trailer

Post by Krazykoolrohit »

wahi80 wrote:

Code: Select all

Header1
Det Records1 (Width 80)
Trailer1
Header2
Det Records2 (Width 80)
Trailer2
Header3
Det Records3 (Width 80)
Trailer3
Read each line as one record into a column1 defined as varchar 200.

Use a tranformer to sort the rows out into various links. you can build the logic inside transfomer that says that if column1 = "Header1" then send next 2 records to link1.
Post Reply