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


Please Help Members By Posting Answers For Below Questions

What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?

1866


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?

1988


What are orabulk and bcp stages?

865


How many types of hash files are there?

845


What is "fatal error/rdbms code 3996" error?

921


What is the difference between datastage and informatica?

842


What is the method of removing duplicates, without the remove duplicate stage?

775


Why we use surrogate key?

920


Explain usage analysis in datastage?

879


If we take 2 tables(like emp and dept),we use join stage and how to improve the performance?

1833


In work load management there are three options of Low priority, Medium priority and High Priority Jobs which can be used for resource management. why this feature is developed when there is already jobs prescheduled by scheduler or autosys. what will be the use of workload management then?

1246


how to connect source to db?generally what r stages u used? how to find the data is having delimiter format?

2139


What are the job parameters?

922


How you Implemented SCD Type 1 & Type 2 in your project?

3891


How do you import and export data into datastage?

950