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 rejected rows are managed in datastage?

0 Answers  


what are the types of nodes

4 Answers   HCL, TCS,


In my project source data comes from MAINFRAME in files.so,This time data is coming as a binary file...I know for binary data we use Complex flat file stage..I have used it also..but on 'view data' data is not coming correctly..as it in MAINFRAME.give me some ideas..

2 Answers  


How many partitions does a node can have? Some body explain me clearly about the partitions and the nodes?

3 Answers  


insequential file 2header avaliable,and 100 records avaliable.how to skip the 2 headers and load 100 records target?

5 Answers  






hi everbody, i have a problem in my project.. Native Error Code: -407 "Assignment of a null value to a not null column"  hi everbody, i have a problem in my project.. Native Error Code: -407 "Assignment of a null value to a not null column" i have no idea, what should i do..please help :(

3 Answers  


HOW U CAN ABORT THE JOB IF THE DATA IS DUPLICATE?

1 Answers   IBM,


4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 please send me answer this question my mail

1 Answers  


wt is the difference between swith and filter stage

6 Answers   IBM,


what is the use of materialized view?

0 Answers   CTS,


Why fact table is in normal form?

0 Answers  


data stores in which location while using data set stage as the target?

1 Answers   IBM, TCS,


Categories