In the source seq file have 2 columns, i.e
input:
col1,col2
1,1
2,rajesh
3,15000
4,2
5,suresh
6,16000
7,3
8,veeru
9,17000
I want in the output like:
eno,ename,sal
1,rajesh,15000
2,suresh,16000
3,veeru,17000
any one answer this scenario
Answers were Sorted based on User's Feedback
SRC--->TFM--->PIVOT----> TGT
In TFM, use below logic
col1 MOD 3----->col1
then out from TFM is:
col1,col2
1,1
2,rajesh
0,15000
1,2
2,suresh
0,16000
1,3
2,veeru
0,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and pivot column is 'col2' then we will get desired output.
Is This Answer Correct ? | 5 Yes | 1 No |
SRC--->TFM--->PIVOT----> TGT
In TFM, use below logic
if col1<4 then 1 elseIf col1>3 AND col1<7 then 2 else 3-----
>col1
then out from TFM is:
col1,col2
1,1
1,rajesh
1,15000
2,2
2,suresh
2,16000
3,3
3,veeru
3,17000
In PIVOT, do vertical PIVOT, group by column is 'col1' and
pivot column is 'col2' then we will get desired output.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / bharath
if inputlnk.col1%3= 1 then outputlnk.col1=inputlnk.col2
else inputlnk.col2
if inputlnk.col1%3= 2 then outputlnk.col2=inputlnk.col2
else inputlnk.col2
if inputlnk.col1%3= 0 then outputlnk.col3=inputlnk.col2
else inputlnk.col2
use above conditions in transformer stage
and then
change the column names using modify stage
as col1 = eno
col2 = ename
col3 = sal
let me know right answer, if i'm wrong...
..
Is This Answer Correct ? | 3 Yes | 5 No |
I/p : F1 table have A,B,C,D,E and F2 table having C,E,V i need output 0utput1: ABD output2: V any one suggest me this
My source having following data as below, AB1 Aim2 Abnv5 1An8bx and my question is i need the Datastage job the following as in my target 000AB1 00Aim2 0Abnv5 1An8bx Please help me to achive this.
how to convert rows into columns
if we using two sources having same meta data and how to check the data in two sources is same or not? and if the data is not same i want to abort the job ?how we can do this?
Explain datastage architecture?
Describe the architecture of datastage?
I am defining one varaible parameter date in job parameters.I want use this variable date in where clause in source query.
How to RD using transformer?
What is orabulk stage?
How a routine is called in datastage job?
how can we create rank using datastage?what is the meaning of rank?
How to enter a log in auditing table whenever a job get finished?