title: Flatten Multiple Observations in SAS
body: <p>I have a data set where a patient can have multiple (and unknown) values for some variables that ends up looking something like this:</p>
  
  <pre><code>    ID   Var1   Var2   Var3   Var4
      1    Blue   Female 17     908
      1    Blue   Female 17     909
      1    Red    Female 17     910
      1    Red    Female 17     911
  ...
      99   Blue   Female 14     908
      100  Red    Male   28     911
  </code></pre>
  
  <p>I want to pack this data down so that each ID has only a single entry, with indicators for the presence or absence of one of the values in their original slew of entries. So, for example, something like this:</p>
  
  <pre><code>ID   YesBlue   Var2      Var3   Yes911
  1    1         Female    17     1
  99   1         Female    14     0
  100  0         Male      28     1
  </code></pre>
  
  <p>Is there a straightforward way to do this in SAS? Or failing that, in Access (where the data is coming from) which I have no idea really how to use.</p>