I want to compare these two datasets and want an output, which says id 3 has different size when compared and id 2,4,5 has same size for both the datasets.
data a;
input id size ;
cards;
1 3
2 4
3 5
4 6
5 7
;
data b;
input id size;
cards;
2 4
3 6
4 6
5 7
;
proc sql;
create table want as
select a.*,ifc(a.size=b.size,'same','different') as remark
from a a,b b
where a.id=b.id;
quit;
data one;
input id size;
cards;
1 3
2 4
3 5
4 6
5 7
;
data two;
input id size;
cards;
2 4
3 6
4 6
5 7
;
proc sql;
create table diff_size as
select * from two
except
select * from one;
create table same_size as
select * from two
intersect
select * from one;
quit;
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.