For categorical values, you have to find the most popular value yourself:
data test;
input sku $ Supplier $ StackHeight $;
datalines;
123 Sony 5
123 Sony 5
123 Sony .
124 LG 4
124 LG 3
124 LG .
124 LG 4
125 Toshiba 5
125 Toshiba 5
125 Toshiba .
;
proc sort data=test; by sku supplier StackHeight; run;
proc sql;
create table freqs as
select sku, supplier, StackHeight, count(*) as n
from test where StackHeight is not missing
group by sku, supplier, StackHeight
order by sku, supplier, n desc;
quit;
data modes;
set freqs; by sku supplier;
if first.supplier;
drop n;
run;
proc sql;
update test
set StackHeight =
(select StackHeight
from modes
where sku=test.sku and supplier=test.supplier)
where StackHeight is missing;
quit;
... View more