how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?

Answers were Sorted based on User's Feedback



how to get second highest salary from a employee table and how get a 5th highest salary from a empl..

Answer / richa

It can be done by first sorting the dataset in the
ascending order of salary and then using the 'point='
option.

For eg:

proc sort data = x;
by salary;
quit;

/*second highest salary*/
data y;
a = 2;
set x point = a;
stop;
run;

/*fifth highest salary*/
data y;
a = 5;
set x point = a;
stop;
run;

Is This Answer Correct ?    1 Yes 9 No

Post New Answer

More SAS Interview Questions

Hi im new to sas. I have a file with some charecter variables and some numeric variables now i want to load charecter variables into one datastep and numeric variables into another data step pls let me know Thanks

2 Answers  


what is Global Symbol table and Local symbol table?

4 Answers   CitiGroup,


What is LAG function?How is it used? can any one explain

3 Answers   TRE, Verinon Technology Solutions,


There are 200 observations in a dataset, i want to pull out the observation no's 100, 150,180,190 by using Proc SQL? How you can get it?

5 Answers  


· What are some good SAS programming practices for processing very large data sets?

6 Answers   Quintiles,






what is study design in while working with SAS? what are screening variables in SAS?

0 Answers   MSCR,


Which is the Best SAS training Institute in Delhi NCR for SAS certification preparation

1 Answers   SAS,


how do you validate sas program?

6 Answers   Accenture,


If reading a variable length file with fixed input, how would you prevent SAS from reading the next record if the last variable didn’t have a value?

3 Answers   Accenture,


which features do you use to check the data validations and errors? : Sas-administrator

0 Answers  


How would you delete duplicate observations?

9 Answers  


How did you use the round function?give an example(don't say it will round to the nearest intger) eg1:round(84.55,.1) =84.6 eg2:round(92.64,.1)=92.6,How it is happening like this tell me the logic,that is how the round function works when we have deimal values?

2 Answers   BoA,


Categories