eno ename
1 qaz
1 wsx
1 edc
2 zxc
2 asd
3 qwe
3 wer
3 tru
4 rgj

Output:

eno ename count
1 qaz,wsx,edc 3
2 zxc,asd 2
3 qwe,wer,tru 3
4 rgj 1

I want the above output to be solved by DataStage as well and I have to write SQL query for the same output.

Answer Posted / purba

For Datastage:
I/p........sort stage(create key change column for empno.)........ transformer ( here take stage variables count=0,sv1. For sv1 give derivation as(if keychange=1 then sv1=ename else sv1=sv1:',':ename) for count derivation (if keychange=1then count=1 else count=count +1).........remove duplicate stage(retain last)......o/p(desired result)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to delete one row in target dataset

2584


Differentiate between datastage and datastage tx?

591


Define ds designer?

766


project Steps,hits, Project level HArd things,Solved methods?

1623


how to use self join using datastage ? can u tell me using stage how can we implemnet the self join

4557






Source has 2 columns: USA,NewYork INDIA,MUMBAI INDIA,DELHI UDS,CHICAGO INDIA,PUNE i want data in target like below: INDIA,MUMBAI1 INDIA,DELHI2 INDIA,PUNE3 USA,NEWYORK1 USA,CHICAGO2

346


How can we improve the performance in datastage?

647


What is the difference between the local container and shared container?

643


What are datastage sequences?

666


How can we improve performance of data stage jobs?

612


What is job control?

620


What is difference between join, merge and lookup stage?

634


What is data partitioning?

739


What are the types of hashed files in data stage

640


Can you explain link buffering?

724