DATA Step, Macro, Functions and more

Two tables bring in unmatch

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 78
Accepted Solution

Two tables bring in unmatch

Hi I have 2 tables 3 columns I want to join them and show my output where text they don't match each tables the 1st table look like this
Table1
ID. Date. .. Text
AZ. 01/01/16. AZ 01/01/16
TX. 02/02/16. TX. 02/02/16
The second. table
ID. Date. Text
AZ. 01/01/16. AZ 01/01/16
TX. 02/02/16. TX 02/0216

THE OUTPUT
I'D. DATE. TEXT
TX. 02/0216

Accepted Solutions
Solution
‎02-16-2017 09:42 PM
Super User
Posts: 11,343

Re: Two tables bring in unmatch

If I understand what you want this may work:

proc sql;
   create table want as
   select table2.*
   from table2 left join table1
   on table2.id=table1.id and table2.date=table1.date
   where table2.text ne table1.text;
run;

View solution in original post


All Replies
Solution
‎02-16-2017 09:42 PM
Super User
Posts: 11,343

Re: Two tables bring in unmatch

If I understand what you want this may work:

proc sql;
   create table want as
   select table2.*
   from table2 left join table1
   on table2.id=table1.id and table2.date=table1.date
   where table2.text ne table1.text;
run;
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 121 views
  • 0 likes
  • 2 in conversation