לא בטוח שהבנתי את הבעיה אבל משהו כזה?
data TEST_DATA;
length
ID 8
Sum 8;
input id sum;
datalines;
1 37
2 23
3 23
4 12
;
run;
data TEST_DATA1;
set TEST_DATA;
retain Actual_Min .;
if _n_=1 then actual_min=sum;
if sum<actual_min then actual_min=sum;
run;