proc sql;
create table new_data_nameas
select *, as
count(distinct RP) as RP_countfrom
from old_data_name
group by ID;
run;
proc sql;
create table new_data_nameas
select *, as
count(distinct RP) as RP_countfrom
from old_data_name
group by ID;
run;