Hi Friends,
I have a input data like,
class_id Marks
101 50
101 60
101 40
102 90
102 35

And i want my output data like
class_id Marks Rank
101 50 2
101 60 1
101 40 3
102 90 1
102 35 2

how to do this in datastage?

Answer Posted / anki_sri

Src>> Sort1 >> Sort2 >> Transfrmr >> Trgt

Sort1 --> sort with class_id and marks as well.
Sort2 --> declare key as id and select Dont Sort(Previously Sorted) and set create cluster key change column as True.

Transfrmr --> set two stage variables.
StageVar1=If Clusterkeychange=1 then Clusterkeychange else StageVar+1

StageVar=StageVar1
Create a new row as rank in transfrmr output and map StageVar1 to rank

Is This Answer Correct ?    3 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

disign the complex job in u r project?(they are aksing only complex job design and then data flow...)

2082


What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?

1637


What are the components of ascential data stage?

650


How many types of stage?

678


What is the purpose of pivot stage?

608






what is the difference between == and eq in UNIX shell scripting?

972


What are the functionalities of link partitioner?

620


What is the precedence of stage variables,derivations, and constraints?

600


What is datastage engine?

730


How to reverse the string using unix?

2812


What is difference between join, merge and lookup stage?

638


What is difference between server jobs & parallel jobs?

625


How to implement complex jobs in data stage?

618


How and where you used hash file?

659


What can we do with datastage director?

675