Use subquery. such as below proc sql;
select c1.make,
c1.model,
c1.invoice,
(
select count(*)
from sashelp.cars c2
where c2.make=c1.make
and c2.invoice>=c1.invoice
) as rankings
from sashelp.cars c1
order by c1.make,c1.invoice DESC
;
run;
... View more