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
What is datastage?
Lookup constraints
How do you run datastage job from the command line?
what are the errors,warnings in datastage
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...
8000 jobs r there i given commit, suddenly job will abort? what happens? 2)diff b/t transformer stage & filter stage? 3)how to load the data in the source?
What is a folder? Difference types of stages?
What are the important features of datastage?
WAT TYPE OF PL/SQL QUERRYS USED IN DATASTAGE
how to write server Routine coding?
Terminate Activity
how to sort two columns in single job in datastage.
What is the command line function to import and export the ds jobs?
How do you import and export the datastage jobs?
Difference between ‘validated ok’ and ‘compiled’ in data stage?