Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4300
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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