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

Answer Posted / pricil kurian

/*sort employee table by salary in desending order */

proc sort data=xx nodupkey;
by descending sal ;
run;
/*outputting the second and 5th largest salary to then yy
dataset */
data yy;
set xx;
if _n_ in (2, 5) then output;
run;

Is This Answer Correct ?    35 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2261


what are 5 ways to perform a table lookup in sas? : Sas-administrator

757


what is sas database server? : Sas-di

609


How to limit decimal places for variable using proc means?

586


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

572






How do you convert basic cube to transaction cube and transaction cube to basic cube?

1765


how can you put a "trace" in your program? : Sas programming

573


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

2087


what is the use of sas management console? : Sas-di

611


what are the considerations when picking a SAS/STAT procedure?

2894


Explain the special input delimiters used in sas programming.

578


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1456


What are the differences between proc means and proc summary?

597


What is the use of stop statement?

636


What are the statements in proc sql?

590