[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4301
  • Last Modified:

Join tables in SAS

I have 2 tables: table 1 one with a list of IDs and table 2 with a smaller list of IDs, which are all also in table 1. I want to merge/join the 2 tables in such a manner that I keep all the IDS in table 1, but not the IDS that are in both table 1 and 2. What kind of join do I need to do?
0
migiurgiu
Asked:
migiurgiu
  • 2
1 Solution
 
wolfen351Commented:
proc sql;
  create table3 as
  select * from table1 where id not in (select id from table2) Data
quit;
0
 
wolfen351Commented:
data table3;
  merge table1(in=a) table2(in=b);
  by id;
  if a and not b;
quit;
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now