how to get second highest salary from a employee table and
how get a 5th highest salary from a employee table?
Answer Posted / vidit malhotra
/*Proc RANK method*/
proc rank data=paydept out=order descending ties=dense;
var Salary;
ranks SalaryRank;
run;
proc sql;
select Name,Salary,SalaryRank from order where SalaryRank IN (2,5);
quit;
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
what is sas business intelligence? : Sas-bi
What is program data vector (pdv)?
what do the pad and dim functions do? : Sas programming
How do dates work in sas?
What is the function of output statement in a SAS Program?
what is sas application server, database server, sas olap server and sas metadata server? : Sas-di
For what purposes have you used sas macros? : sas-macro
What are the ways to do a “table lookup” in sas?
explain the proc in sas? : Sas-administrator
What are the five ways to do a table lookup in sas? : sas-grid-administration
Enlist the syntax rules followed in sas statements.
what are informats in sas? : Sas-administrator
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
Name few SAS functions?
what is treatment emergent events and treatment emregent adverse event