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 ?    6 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe the ways in which you can create a macro variable?

619


how do you debug and test your sas programs? : Sas programming

558


Explain translate function?

626


Intern stastical programmer written test

282


How are numeric and character missing values represented internally?

1132






What are the statements in proc sql?

590


explain the key concept of sas? : Sas-administrator

554


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

552


sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately

3105


what are the categories that sas informats are used to the place the data? : Sas-administrator

611


what is hierarchy flattening? : Sas-di

614


what is data integration? : Sas-di

608


How can you limit the variables written to output dataset in data step?

743


Give an example where SAS fails to convert character value to numeric value automatically?

605


Explain how merging helps to combine data sets.

607