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 / msbharathi

Seq stg------>Sort stg--------> Trnsfrm stg-------->Tgt
1. read data in seq file stage.
2. In sort stage enable key column change as true.
3. In transformer stage define stage variable SV1 (if DSLink5.keyChange = 1 then 1 else SV1 +1) and SV2 (if DSLink5.keyChange = 1 then DSLink5.ENAME else SV2 : ',' : DSLink5.ENAME
) . In output tab link ENO, SV2 -> Ename and SV1 -> Count. Add a constraint LastRowInGroup(DSLink5.ENO) and mark the ENO as key in input column.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are stage variables, derivations and constants?

669


Highlight the main features of datastage?

613


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

4555


Where do you see different stages in the designer?

627


How to reverse the string using SQL?

886






What is the difference between informatica and datastage?

650


Differentiate between hash file and sequential file?

576


What is difference between symmetric multiprocessing and massive parallel processing?

649


What is a merge?

666


How to Remove Duplicate using SQL?

839


whom do you report?

1502


Define orabulk and bcp stages?

674


Can you implement SCD2 using join, transformer and funnel stage?

1079


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?

1040


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

609