how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?
Answer Posted / nandu
proc sort data=samp nodupkeys;
by sal descending ;
run;
data samp1 samp2;
set samp ;
ln+1 ;
if ln=2 then output samp2 ;
else samp ;
run;
/*second highest salary obs will come into samp2 dataset */
| Is This Answer Correct ? | 3 Yes | 11 No |
Post New Answer View All Answers
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
Give an example where SAS fails to convert character value to numeric value automatically?
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
What is the basic structure of the SAS base program?
what are input dataset and output dataset options? : Sas programming
What is PDV?
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
what is information maps?
what is SAS OPTIMIZATION?
how do you want missing values handled? : Sas programming
explain the difference between proc means and proc summary?
How many data types are there in SAS?
Explain data step in SAS
Explain translate function?
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?