design question

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
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

design question

Post by harryhome »

Getting input as

Name Addresslineno Address
ABC 1 xyz
ABC 2 bhc
ABC 3 320
DFG 1 frfd
DFG 2 fgfg


Output required is
Name Address1 address2 address3
ABC xyz bhc 320
DFG frfd fgfg

please drop a note to inplemet this logic, if in sql also will do
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Re: design question

Post by SURA »

Refer Pivot stage

DS User
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

Re: design question

Post by harryhome »

Thanks, what should be the derication in output column tab?
addrcolumn where address no = 1?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What you are seeking to achieve is called a "vertical pivot". Search DSXchange for examples.

You need version 8.5 to accomplish a vertical pivot using a PXPivot stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

Post by harryhome »

thanks now I am trying to vertical pivot.

My question is when I have addr1 addr2 and addr3 in my target. and source is having addrtxt and addrno. how to configure stage vertical pivot to populate field addr1 in target when addrno is 1 in source?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is totally the opposite to the requirement you descrived originally. Please confirm what your requirement actually is.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
harryhome
Participant
Posts: 112
Joined: Wed Oct 18, 2006 7:10 am

Post by harryhome »

Srry in case of confusion.

In example mentioned earlier

Name Addresslineno Address
ABC 1 xyz
ABC 2 bhc
ABC 3 320
DFG 1 frfd
DFG 2 fgfg


Output required is
Name Address1 address2 address3
ABC xyz bhc 320
DFG frfd fgfg




So in input i have addrs and addresslineno so in vertical pivot how so map these input columns to address1 , address2 and address3 columns?
Post Reply