data have;
infile datalines dsd;
input
id : 8.
match1 : $8.
match2 : $8.
not_relevant : 8.
;
datalines;
1,"ABC","ABC",4
1,"XYZ","XYZ",29
2,"QQQ","AAA",5
2,"ABC","ABC",9
3,"EFG","EFG",7
3,"DEF","DEF",12
3,"LMK","LMK",16
3,"KEF",,38
;
proc sql;
create table want as
select * from have
where id not in
(select id from have where match1 ne match2 and
match1 is not missing and match2 is not missing);
quit;
... View more