how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?
Answer Posted / 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 ? | 6 Yes | 10 No |
Post New Answer View All Answers
what are the categories that sas informats are used to the place the data? : Sas-administrator
How to create an external dataset with sas code?
what is the function of catx syntax? : Sas-administrator
how can you import .csv file in to sas? : Sas programming
What is connection profile? : sas-grid-administration
Describe the ways in which you can create macro variables?
why is a stop statement needed for the point=option on a set statement? : Sas programming
What are the features of base sas system?
What is the difference between match merge and one to one merge?
Approximately what date is represented by the SAS date value of 730?
What is proc sort?
describe about metadata object? : Sas-di
What is the sas data set? : sas-grid-administration
What are the difference between the sas data step and sas procs?
What is the difference between using drop = data set option in data statement and set statement?