假设数据集的名字是test:
proc sql;
create table wanted as
select sxid, b.id, a.name, a.group
from test a left join (select distinct id, name, group from test where ^missing(id)) b
on a.name=b.name and a.group=b.group
order by 1;
quit;
proc sql;
create table wanted as
select sxid, b.id, a.name, a.group
from test a left join (select distinct id, name, group from test where ^missing(id)) b
on a.name=b.name and a.group=b.group
order by 1;
quit;