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


Please Help Members By Posting Answers For Below Questions

What is the maximum length of the macro variable?

682


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

1924


Explain the use of proc gplot? : sas-grid-administration

556


Do you need to rearrange the order of the data for the report?

1842


What is a put statement?

668






how does sas handle missing values in functions? : Sas programming

606


where are dashboard components are created and maintained? : Sas-bi

574


How we can create SAS USER DEFINED CODE?

1618


I have a dataset concat having a variable a b & c. How to rename a b to e & f?

768


Can you explain the process of calendar?

648


what is hash files in sas and why we are using this one in sas?

1734


what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

737


State the difference between INFORMAT and FORMAT ?

599


What are the functions which are used for character handling functions?

620


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?

645