how can i get 2nd highest salary in datastage?can u send me
,thanQ
2)if i had source has 2 records 1st record ie 1st column
contains 1,2,3 and 2nd coulmn contains 10,10,10 i have to
get target as 2nd columns as 20,30,40 how can i?

Answers were Sorted based on User's Feedback



how can i get 2nd highest salary in datastage?can u send me ,thanQ 2)if i had source has 2 record..

Answer / farzana kalluri

seq file--->sort(descending)stage--->surrogate key stage---
>target


sort tha data in descending order ,then it will shows from
highiest salary, after that keep surrogate key stage it
will automtaically generates the nos so that we can
identifiy the 2nd hieght salary .

Is This Answer Correct ?    9 Yes 1 No

how can i get 2nd highest salary in datastage?can u send me ,thanQ 2)if i had source has 2 record..

Answer / subhash

for 2nd Qn:
Source is:
Col1 Col2
1 10
2 10
3 10
In transformer, we put the below logic:

Link.Col1 * Link.Col2 + Link.Col2------>Col2

1*10+10------------->20
2*10+10------------->30
3*10+10------------->40

Hope this is fine.

Is This Answer Correct ?    7 Yes 1 No

how can i get 2nd highest salary in datastage?can u send me ,thanQ 2)if i had source has 2 record..

Answer / ram

there are two ways you can get.
1. sort the data in descending order and make true the
create key change column.
2. this can be done in transformer stage at stage variables.
a. first sort the data on descending order (key would the
column which you wanted to be).
define three stage variables in transformer....sv1,sv2 & sv3
set sv2 and sv3 initial values to 0.
then...
if (salary=sv3) then sv2 else (sv2+1) ------> sv1
sv1 -------> sv2
salary --------> sv3

in next link filter...
constraint sv1=1
now you can see all 1st highest salary, 2nd highest
salary..and so on

Is This Answer Correct ?    5 Yes 6 No

Post New Answer

More Data Stage Interview Questions

How to display all the duplicate records from the oracle Table?

3 Answers   IBM,


Scenario : I have 2 jobs say job A and Job B with parameters x and y respectively. I need to create a sequence job. If we pass parameter x then Job A should run, If we pass parameter y then Job B should run, if we dont pass any parameter then Both Job A & B should run.

4 Answers   iGate, Thirdware,


What is PX?

2 Answers   IBM,


What is use Array size in datastage

0 Answers  


Describe link sort?

0 Answers  






parallel jobs run on cluster machines. server jobs run on smp and mpp. What do mean by cluster mechines and SMP and MPP..?

3 Answers  


1)What is ur project architecture ? 2)how to move project from developement to uat? 3)What is the difference between datastage 6,7.1 and datasttage 7.5? 4).How to do error handling in datastage? 5)3.Whta is unit testing, system testing and integration testing? 6)What is the Exact difference between BASIC Transformer and NORMAL Transformer?When we will go for BASIC Or NORMAL Transformer 7)why we use third party tools in datastage? 8)What is the purpose of Debugging stages? In real time Where we will use?

6 Answers   CTS, HCL, IBM, Wipro,


Sequential file i have one record,i want 100 records in target?How can we do that?Pls explain me and what stages are there?What logic?

1 Answers   TCS,


Hi, I have 3 records, 1 Srini 1 vasa 2 reddy now i want o/p like this 1 Srinivasa 2 reddy could u please help in this Thanks in advance.

6 Answers   Teradata,


if the source file is CID,CCODE,CONNDATE,CREATEDBY 0000000224,1000,20060601,CURA 0000000224,2000,20050517,AFGA 0000000224,3000,20080601,TUNE 0000000225,1000,20020601,CURA 0000000225,2000,20050617,AFGA 0000000225,3000,20080601,TONE AND TARGET is oracle following are the validations cid loaded with unique records leading zeors has to be deleted while loading cid in target load only customer who got early connected to company conn_date should be loaded into oracle date format cid datatype is varchar2 in target conn_date is data datatype ccode is varchar2 0000000224,1000,20060601,CURA 0000000224,1000,20060601,CURA

2 Answers  


How to create a doccument in datastage?

1 Answers   Cap Gemini,


Lookup constraints

0 Answers   CTS,


Categories