Input Data is:
Emp_Id, EmpInd
100, 0
100, 0
100, 0
101, 1
101, 1
102, 0
102, 0
102, 1
103, 1
103, 1
I want Output
100, 0
100, 0
100, 0
101, 1
101, 1
Means Indicator should either all ZEROs or all ONEs per
EmpId.
Impliment this using SQL and DataStage both.
Answer Posted / subhash
1. SQL:
SELECT * FROM
( SELECT EmpId, COUNT(*) AS CNT1 FROM EMP GROUP BY
EmpId) E1,
( SELECT EmpId, COUNT(*) AS CNT2 FROM EMP GROUP BY
EmpId, EmpInd) E2,
WHERE E1.EmpID = E2.EmpId AND
E1.CNT1 = E2.CNT2;
2.DataStage:
SRC--->CPY---->JOIN----TFM---TGT
| /
| /
| /
| /
AGG
In AGG, GROUP BY EmpId, calculate CNT and SUM.
JOIN both one copy from CPY and 2nd Aggrigated copy from
AGG.
In TFM, put constraint: IF CNT=SUM, then populate to TGT
then u will get required output.
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
How can you write parallel routines in datastage PX?
EXPLAIN SCD
Distinguish between informatica & datastage. Which one would you choose and why?
Can you define merge?
What is the importance of the exception activity in datastage?
Can anyone tell me a difficult situation who have handled while creating Datastage jobs?
What are the main differences you have observed between 7.x and 8.x version of datastage?
How can we improve the performance in datastage?
What is the difference between passive stage and active stage?
Can you highlight the main features of ibm infosphere information server?
Can you explain repository tables in datastage?
What are the stages in datastage?
On which Dimension Table you implemented SCD Type in your Project
project Steps,hits, Project level HArd things,Solved methods?
What are the different layers in the information server architecture?