Then run this code, based on my earlier "have" dataset:
proc sql;
create table flag as
select
paramcd,
case
when count(distinct aval) = 1
then 'Y'
else ' '
end as flag
from have
group by paramcd
having flag = 'Y';
quit;
data want;
merge
have
flag
;
by paramcd;
if not first.paramcd then flag = ' ';
run;