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.
Answers were Sorted based on User's Feedback
Answer / himanshu jain
you can achieve this with AGGREGATOR and PIVOT ENTERPRISE stage in DATASTAGE Designer. First get count by using AGGREGATOR stage and then do Pivoting.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
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 |
tab1 tab2 1,a 1,d 2,b 3,c perfoms outerjoin what is the o/p? write sql query for outerjoin?
What is the Difference between Change capture stage and Difference Stage ? What are its significance individually ?
I have source like "abcdefghijklmnopqrs", how to change 10th character from j to z in datastage?
i have the source from Uk,north america how can i pass the data two tables based on the locations
I have 5 different sources i want same records in 5 different targets Can you any body send me this question answer rathdsetl@gmail.com
Which algorithm you used for your hashfile?
What are stage variables?
I have a file it contain 2 records like empname,company as Ram, Tcs and Ram, IBM. But i want empname, company1,company2 as Ram, TCS,IBM in the target. How?
My source having following data as below, AB1 Aim2 Abnv5 1An8bx and my question is i need the Datastage job the following as in my target 000AB1 00Aim2 0Abnv5 1An8bx Please help me to achive this.
What is the purpose of pivot stage and types of containers in datastage
Hi Vijay here For Four CPU's how many nodes will required?
Hi guys, 7. how to get this output i/p col1,col2 101,a 102,b 103,c 104,d o/p col1,col2 101,d 102,c 103,b 104,a Thanks