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
What is the difference between input and infile statement?
Do you need to know if there are any missing values?
name several ways to achieve efficiency in your program? : Sas programming
Mention what is the difference between nodupkey and nodup options?
Define run-group processing?
what is intially documentation in sas?
What are the implications?
Difference between sum function and using “+” operator?
What do you know about symput and symget?
What are the table names in oracle database...?
Explain how merging helps to combine data sets.
how can you put a "trace" in your program? : Sas programming
what is ae onset date n what is RDS
why is sas considered self-documenting? : Sas programming
What are the automatic variables for macro? : sas-macro