Wow, that datastep is so clean compared to a Proc SQL. I needed Proc SQL for my case because with Proc SQL it will not print anything to the output window if the dataset is empty.
Thank you for the help!
And I really need to read more about coalesce and full joins!
data ONE;
input ID X $;
cards;
1 a
2 .
3 c
6 a
;
data TWO;
input ID Y $;
cards;
1 a
2 b
5 d
6 e
;
proc sql;
create table want as
select coalesce(a.id,b.id) as id,x,y
from
(select * from one except select * from two) as a
full join
(select * from two except select * from one) as b
on a.id=b.id;
quit;
Thank you Ksharp! both your code and Reeza's worked. I would have accepted both as a solution but it only allowed me to pick one so I just picked one that replied earlier hopefully you are okay with it. I really appreciate your help on this! I learned from both of your codes! Thanks again!
SAS Innovate 2025: Register Now
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9. Sign up by Dec. 31 to get the 2024 rate of just $495. Register now!