convert input to out put

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
murari83.ds
Participant
Posts: 9
Joined: Sun Aug 19, 2007 11:44 pm

convert input to out put

Post by murari83.ds »

Hi

I have a file like

Seg file 1

A, B
1, a
1,b
1,c
2,d
2,e
2,f

conver to

out file
A, B
1 abc
2 def


Thanks
murari
ramakrishna
Maveric
Participant
Posts: 388
Joined: Tue Mar 13, 2007 1:28 am

Post by Maveric »

Do a search on "Vertical Pivot". See if the posts help.
ggs
Participant
Posts: 7
Joined: Mon Oct 01, 2007 7:14 am
Location: Hyderabad

Re: convert input to out put

Post by ggs »

Hi Murari,
I worked on this type of conversion:
Input:
ColA ColB ColC ColD
1 a b c
2 d e f

output:
ColA ColB ColX ColY
1 a ColC b
1 a ColD c
2 d ColC e
2 d ColD f

In this job i have used a transformer stage for combining the Column names(ColC,ColD) and Column values(b,c,e,f) using a DELIMITER.

And next i used a Pivot stage to change those Column names to Rows.(here i used 'FIELD' function to seperate those Column names&values.

Hope this will hepl you.





murari83.ds wrote:Hi

I have a file like

Seg file 1

A, B
1, a
1,b
1,c
2,d
2,e
2,f

conver to

out file
A, B
1 abc
2 def


Thanks
murari
Post Reply