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

What is process model?

1553


How do you start developing a datastage project?

660


What is the purpose of pivot stage and types of containers in datastage

611


How to write a expression to display the first letter in Caps in each word using transformer stage ? Please let me know ASAP Thanks in advance...

1082


what is use of SDR function?

4710






What is the use of hoursfromtime() function in transformer stage in datastage?

585


what is ds administrator used for?

722


Define ds designer?

768


Difference between in process and inter process?

701


How do you schedule or monitoring the job?

671


How can we perform the 2nd time extraction of client database without accepting the data which is already loaded in first time extraction?

1702


Field,NVL,INDEX,REPLACE,TRANSLATE,COLESC

970


What are the different types of lookups in datastage?

631


What is the command line function to import and export the ds jobs?

681


What is the difference between an operational datastage and a data warehouse?

637