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
Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between datastage and datastage tx?
What is datastage engine?
How and where you used hash file?
What are the types of jobs we have in datastage?
What is process model?
Name the different types of Lookups in Datastage?
how to implement scd2 in datastage 7.5 with lookup stage
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?
Explain ibm infosphere information server and highlight its main features?
Can you explain players in datastage?
How can we improve performance of data stage jobs?
How to Remove Duplicate using SQL?
What is ds designer?
Which is the best institute in Hyderabad to learn OBIEE and DataStage?Please tell me faculty name also
1.new record it will insert but changes of natural key is not present in taget i want to update (here key is composite natural key )can any one help this to explan how to do