title: SAS: Remove observations from data set if they match an observation in another data set
body: <p>I'm just learning SAS. This is a pretty simple question -- I'm probably overthinking it.</p>
  
  <p>I have a data set called <code>people_info</code> and one of the variables is <code>SocialSecurityNum</code>. I have another table called <code>invalid_ssn</code> with a single variable: unique and invalid <code>SocialSecurityNum</code> observations. </p>
  
  <p>I would like to have a DATA step (or PROC SQL step) that outputs to <code>invalid_people_info</code> if the <code>SocialSecurityNum</code> of the person (observation) matches one of the values in the <code>invalid_ssn</code> table. Otherwise, it will output back to <code>people_info</code>. </p>
  
  <p>What's the best way to do this? </p>
  
  <p><strong>Edit: More info, to clarify...</strong></p>
  
  <p><code>people_info</code> looks like this:</p>
  
  <pre><code>name     SocialSecurityNum
  joe      123
  john     456
  mary     876
  bob      657
  </code></pre>
  
  <p><code>invalid_ssn</code> looks like this:</p>
  
  <pre><code>SocialSecurityNum
  456
  876
  </code></pre>
  
  <p>What I want is for <code>people_info</code> to change (in place) and look like this:</p>
  
  <pre><code>name     SocialSecurityNum
  joe      123
  bob      657
  </code></pre>
  
  <p>and a new table, called <code>invalid_people_info</code> to look like this:</p>
  
  <pre><code>name     SocialSecurityNum
  john     456
  mary     876
  </code></pre>