Hi, I need to find differences between two datasets. I need to leave out one variable but need it from dataset2 in the dataset created.. So find the difference between rows in all columns except one column that will always be different and then keep that column in the created table with the data from one of the compared tables. The column I dont want to compare contains the date the dataset was created and I need to keep the date from one of the datasets. This is the code I have that works fine when comparing all columns. This code is applied on many different tables with different amount of columns. The column I want to ignore in the compare but keep in the result will always have the same name, DATE: data data_today;
input employee $ salary $ date $;
datalines;
Smith 40000 20220419
Cool 00004 20220419 Me 000055 20220419
;
run;
data data_yesterday;
input employee $ salary $ date $;
datalines;
Smith 40000 20220418
Cool 00003 20220418 Me 000055 20220419
;
run;
proc sql;
create table Help as
select * from data_today
except
select * from data_yesterday;
quit; Result wanted: Cool 00004 20220419 The result should only contain 'Cool' because she has a different salary. Smith or Me should not be included because it's only the date that is different: This is applied on many different tables so I have to use select * , but the date column will always have the same name. Thanks!
... View more