1
如何找到SAS中最大值的記錄?我有以下結構的數據集:在SAS中找到最大值的記錄
age name
12 joe
15 jane
3 bob
14 rick
我想找個「名」的這「年齡」是最大的值(在這個例子 - 「簡」)。
我嘗試這樣做:
data max;
set ages_data;
if age > max_age then do;
max_age = age;
max_name = name;
end;
retain max_:;
keep max_:;
run;
這是基於什麼我發現這裏: https://communities.sas.com/message/170554
,但它並沒有爲我工作......我究竟做錯了什麼?
感謝
謝謝!這正是我需要的 - 完美的作品 –