How to read a file having record delmiter as blank line

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
bgs_vb
Premium Member
Premium Member
Posts: 79
Joined: Mon Jan 02, 2006 5:51 am

How to read a file having record delmiter as blank line

Post by bgs_vb »

Hi ,
I am getting input data as follow in a sequential file:

a: test us,osjkjkj
b: ab
c: defhj

a: tes1t usa,osjkjkj
b: cd

a: tt usa,osjkjkj
b: ef
c: ghij
d: defhj

Required output format is :

a|b|c|d
test us,osjkjkj|ab|defhj|NULL
tes1t usa,osjkjkj|cd|NULL|NULL
tt usa,osjkjkj| ef|ghij| defhj

Note: a,b,c,d are column names

I am not sure how to achieve this result . Please advise which stage i can use to achieve this in datastage .
swarnkar
Participant
Posts: 74
Joined: Wed Jan 11, 2006 2:22 am

Re: How to read a file having record delmiter as blank line

Post by swarnkar »

You can pass your source file through a simple script where you can replace enter character with comma or some other delimiter and then
blank lines with enter chacter and change.

Thanks,
Nitin Swarnkar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search DSXchange for "vertical pivot", for this is what you are trying to accomplish.
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