How do you add a row Number in SAS by multiple groups with one variable in decending order?
问题 I have discovered this code in SAS that mimics the following window function in SQL server: ROW_NUMBER() OVER (PARTITION BY Var1,var2 ORDER BY var1, var2) = data want; set have by var1 var2; if first.var1 AND first.var2 then n=1; else n+1; run; "She's a beaut' Clark"... but, How does one mimic this operation: ROW_NUMBER() OVER (PARTITION BY Var1,var2 ORDER BY var1, var2 Desc) I've made sure I have before: PROC SORT DATA=WORK.TEST OUT=WORK.TEST; BY var1 DECENDING var2 ; RUN; data WORK.want;