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

Answer Posted / poorna m

proc sort data=emp out=emp1 nodupkey;
by descending sal empid;
run;

PROC RANK DATA=emp1 OUT=emp3 TIES=LOW DESCENDING;
VAR sal ;
RANKS highestsal;
RUN;

data emp4;
set emp3;
where highestsal in (2,5);
run;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you delete duplicate observations in sas?

571


What is the basic syntax style in SAS?

612


Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?

1908


What is the SAS data set?

672


In sas admin differentiate between roles and capabilities? : sas-grid-administration

552






Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro

694


Explain input and put function?

643


Have you ever used the SAS Debugger?

1203


What does P-value signify about the statistical data?

847


What sas features do you use to check errors and data validation?

680


Explain how you can debug and test your SAS program?

562


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

2894


how does sas handle missing values in sort order? : Sas programming

524


Differentiate between format and informat? : sas-grid-administration

575


Differentiate between sas functions and sas procedures.

637