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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss. Register now and lock in 2025 pricing—just $495!