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

Input->Sort1->Sort2->Trnsformer->Output

Sort1-->Declare class_id and Marks as key column and sort
in descding order.
Sort2-->Declare class_id and Marks as key column(Sort Mode
to Dont sort previously sorted for both) and set clustered
key change column to true.

Otuput for Sort 2 will be

class_id Marks Rank
102 90 1
102 35 0
101 60 1
101 50 0
101 40 0

In the Transformer declare stage variable temp and
initialize to o

Derive temp--> If Rnak=1 then Rank else temp+1

Derive output columns as --->

class_id ---> class_id
Marks ----> Marks
Rank----> temp

Is This Answer Correct ?    13 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is the value of staging variable stored temporarily or permanently?

564


What are the steps needed to create a simple basic datastage job?

644


What is a ds designer?

633


What are the types of containers?

668


What are routines in datastage?

763






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

1628


Can you explain players in datastage?

698


How do you reject records in a transformer?

620


project Steps,hits, Project level HArd things,Solved methods?

1623


What are the functionalities of link partitioner?

608


Which warehouse using in your datawarehouse

1672


client know skid info?

1625


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?

1035


What can we do with datastage director?

663


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

585