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 ? | 1 Yes | 9 No |
Post New Answer View All Answers
Difference between informat and format?
Give an example where SAS fails to convert character value to numeric value automatically?
what are validation tools that are used in sas? : Sas-administrator
Are you involved in writing the inferential analysis plan? Tables specfications?
what is the difference between floor and ceil functions in sas? : Sas-administrator
How would you identify a macro variable? : sas-macro
What are the different servers in sas? : sas-grid-administration
How to specify variables to be processed by the freq procedure?
Are you involved in writing the inferential analysis plan? Tables specifications?
describe about physical data integration? : Sas-di
describe about metadata object? : Sas-di
Intern stastical programmer written test
How to convert a numeric variable to a character variable?
what is change analysis in sas di ? : Sas-di
Mention the validation tools used in SAS?