본문 바로가기

전산Tip/SAS

SAS로 오라클 dense_rank() 처럼 하기

반응형


rsubmit;
proc sql;
        create table temp_5 as
        select  col1
                , col2
                , col3
                , sum(var1) as var1
        from    temp_4
        group by 1,2,3
        order by 1,2
        ;
quit;
endrsubmit;

rsubmit;
proc rank data=temp_5 out=temp_5_1 ties=dense;
By col1 col2;
var var1;
ranks pno;
run;
endrsubmit;