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
What is the maximum length of the macro variable?
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
Explain the use of proc gplot? : sas-grid-administration
Do you need to rearrange the order of the data for the report?
What is a put statement?
how does sas handle missing values in functions? : Sas programming
where are dashboard components are created and maintained? : Sas-bi
How we can create SAS USER DEFINED CODE?
I have a dataset concat having a variable a b & c. How to rename a b to e & f?
Can you explain the process of calendar?
what is hash files in sas and why we are using this one in sas?
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
State the difference between INFORMAT and FORMAT ?
What are the functions which are used for character handling functions?
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?