Source Like
department_no, employee_name
----------------------------
20, R
10, A
10, D
20, P
10, B
10, C
20, Q
20, S
and Output should be like this
department_no, employee_list
--------------------------------
10, A
10, A,B
10, A,B,C
10, A,B,C,D
20, A,B,C,D,P
20, A,B,C,D,P,Q
20, A,B,C,D,P,Q,R
20, A,B,C,D,P,Q,R,S
Answers were Sorted based on User's Feedback
small modification to the above ans:
SRC---->Transformer--->TGT
we do the 'HASH' partitioning on Dept_No.
SetNull value to the Stage variable----->SV_List
In the transformer stage variables:
SV_List :',' : Employee_Name ----->SV_List (Concatenating Employee
Names)
In the Column Derivation:
TRIM(SV_list, ',' , 'L')------->Employee_Name
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / srinivas
By using the stage variables in transformer we can do this.
Before going to use transformer sort the data based on two columns.Order should be like below
Deptno Empname
10 A
10 B
SO ON...
After that in transformer take 3 stage varibles
stg1--->map the sorted Deptcolumn
stg2---> DSLink2.empname:',' (map the empname column and concatenate comma operator)
Stg2--->stg3:stg2 (concatenate first two staging varibles)
Then
In derivation of employee_list column (In transformer)
use below function
TRIM(stg3,',','T')---->employee_list (column derviarion)
It will gives you as expected result.
Thanks
Sri
| Is This Answer Correct ? | 5 Yes | 3 No |
SRC---->Transformer--->TGT
we do the 'HASH' partitioning.
SetNull value to the Stage variable----->SV_List
In the transformer stage variables:
SV_List : Employee_Name ----->SV_List (Concatenating Employee
Names)
In the Column Derivation:
SV_list------->Employee_Name
| Is This Answer Correct ? | 3 Yes | 1 No |
what is the custome stage in datastage? how can we impliment that one? plz tell me
In Informatica,for the table I can find coreesponding dependent mappings.Likewise can I find the dependent jobs with all the information by using the table name
What is configuration your file structure 2)I have two databases both are Oracle while loading data from source to target the job takes 30 min but I want to load less time how?
how can u connect the client system directly at any time?
what is set mapping in datastage??
6) my sorce d1 d2 d1 d2 d1 d3 d2 d1 my target tartget 1 d1 2 d1 3 d1 4 d1 target2 1 d2 2 d2 3 d3 Target 3 1 d3 Can any body send me answer this is argent requierment
How to read multiple files at different directories using a single Sequential File stage in DS Enterprise Edition
how many dimentions and fact tables used in your project and what are names of it?
How can we run same job in 1 day 2 times
Wat is pre-load in Hashed file
How do you load dimension data and fact data? Which is first
what is the use of surogate key in datastage