I am sure this would help. Proc compare compares each column from table 1 to table 2 in a row. For example if there is a rundate in table1 and rundate in table2 need not be same even you started to run the code same time to get table1 and table2. For comparing two tables I am sure this is going to be usefulcode. /* first outer join table1 and table2*/ Proc SQL; Create table table1andtable2outerjoin as Select a.id as id_1, a.name as name_1, b.id as id_2, b.name as name_2 From table1 as a Full Outer Join table2 as b on a.id = b.id and a.name=b.name; Quit; /*to see rows only in table2 not in table1 you can add more columns for comparison*/ Data tablenew; Source = 'two'; Length Source $5; Set table1andtable2outerjoin ; if missing(id_1) and missing(name_1) then output; Format Source $5.; Informat Source $5.; run; /*to see rows only in table1not in table2 you can add more columns for comparison*/ Data tableold; Source = 'one'; Length Source $5; Set table1andtable2outerjoin; if missing(id_2) and missing(name_2) then output; Format Source $5.; Informat Source $5.; run; /*to see rows side by side*/ Data tablenewold; Set tablenew tableold; run;
... View more