Question
4)
source target

c1 c1 c2 c3
c2 c4 c4 c5
c3 c6 c7
c4
c5
c6
c7


Singal Source and Singal Target only subash,

Answer Posted / shar

HERE IS Mine answer an alternative without pivot stage:

SRC-->TX1-->TX2-->RemDup-->TRG

from SRC send data to TX1 with RowNumCol
then Data :
col1 Row_Num
c1 0
c2 1
c3 2
c4 3
c4 4
c5 5
c6 6
c7 7

Now in Tx1 take stage variable sv1 and using Row_Num field
give condition as : If Row_Num >=0 And Row_Num <3 Then 1
Else If Row_Num >= 3 And Row_Num <6 Then 2 Else 3
o/p :
col1 col2
c1 1
c2 1
c3 1
c4 2
c4 2
c5 2
c6 3
c7 3

(If you don't know Vertical Pivoting then alternatively we
use another Transformer and Remove Duplicate stages to get
our result)

now at Tx2 we take Three Stage Variables sv1 sv2 sv3 all are
varchar
now we give proper conditions to concatinate input using col2.
Stage variables: Assignment
col2---sv1
If sv1 <> sv3 Then col2 Else sv2 : ',' : col2 --- sv2
col2---sv3

Now at this level u should get o/p as:

newcol1 newcol2
1 c1
1 c1,c2
1 c1,c2,c3
2 c4
2 c4,c4
2 c4,c4,c5
3 c6
3 c6,c7

Finally use Rem Duplicates by selecting
Duplicates to Retain : Last
o/p
1 c1,c2,c3
2 c4,c4,c5
3 c6,c7

(Just in case if you dont want 1st column just drop it using
modify stage or copy stage.)
Yeah i know its a lengthy way and it sucks,
out of curiosity did it mannnnn.
Better use Pivot stage -a wonderful stage

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

options available in sequence job to run,validate?

832


Describe the architecture of datastage?

567


Define Merge?

872


Difference between data warehousing and olap?

650


what is the custome stage in datastage? how can we impliment that one? plz tell me

1909






Name the different types of Lookups in Datastage?

726


What are the enhancements made in datastage 7.5 compare with 7.0?

705


Enlist various types of routines in datastage.

641


Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...

3754


In a batch if a job fails in between and you want to restart the batch from that particular job and not from the scratch then what will you do?

596


What is meta stage?

577


How do you import and export the datastage jobs?

733


What are the some differences between 7.x and 8.x version of datastage?

737


What is a ds designer?

638


How many types of sorting methods are available in datastage?

629