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 / subhash
1. SRC---->TFM---->PIVOT Stage---->TGT
If source is seq file add the ROW NUM column also.
If source is Oracle select ROWNUM column also.
then our input look like this:
COL1 COL2
C1 1
C2 2
C3 3
c4 4
c4 5
c5 6
c6 7
C7 8
in TFM,
put below condition for Col2 derivation.
If COL2<4 AND COL2>0 then 1 elseIf COL@>3 AND COL2<7 then 2 else 3
then out from tranformer looks like this
COL1 COL2
C1 1
C2 1
C3 1
c4 2
c4 2
c5 2
c6 3
C7 3
then do the Vertical PIVOT on
GROUP BY COL2,
PIVOT COL1
then u will get below output:
Col2 COL1_1 COL1_2 COL1_3
1 c1 c2 c3
2 c4 c4 c5
3 c6 c7
we can drop COL2 in TGT
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Define oconv () and iconv () functions in datastage?
What is a ds designer?
What is ibm datastage?
How to convert RGB Value to Hexadecimal values in datastage?
How a routine is called in datastage job?
Define project in datastage?
How complex jobs are implemented in datstage to improve performance?
Define Routines and their types?
What are transforms and what is the differenece between routines and transforms?
What is difference between server jobs & parallel jobs?
How do you reject records in a transformer?
If you want to use a same piece of code in different jobs, how will you achieve this?
Can you explain tagbatch restructure operator?
What is active and passive stage?
What are the benefits of datastage?