title: finding duplicates from multiple datasets in sas by flag
body: <p>I have a dataset arranged like this:</p>
  
  <pre><code>ID  Date  Flag
  A  1/1/11 000
  A  1/1/11 001
  A  1/1/11 010
  B  1/2/11 000
  B  1/3/11 001
  </code></pre>
  
  <p>I set up a flag to keep track of certain columns and separated the original dataset into four smaller ones.  So one for flag='000', one for '001', one for '010' and '011'.  If I do a unique count by ID and Date, I get say 500 for the original dataset.  But for each separate one by flag, if I add up the total I get say 600.  That means 100 records are duplicates, so in my above example A with 1/1/11 is only 1 unique record, but it appears in the sub dataset of '000', '010', '001'.  So out of the 100 extra duplicates, 3 would be A with date 1/1/11.  Is there a way I can figure this out without looking manually which records by flag are duplicates?</p>