title: Subset data by group by proportion in SAS
body: <p>In this data, I need to subset by each variable by certain percentage.
  For example,</p>
  
  <pre><code>Obs Group Score
  1     A    1
  2     A    2
  3     B    1
  4     B    1
  5     C    3
  6     C    1
  7     C    1
  8     A    1
  9     A    3
  10    A    1
  11    A    2
  12    B    3
  13    C    2
  </code></pre>
  
  <p>I would need to subset 10 obs.
  The sample must consist of all groups, and score of 1 takes higher priority.
  Each group is given certain percent.
  Let say 50% for A, 20% for B and 30% for C.</p>
  
  <p>I tried using proc surveyselect but it failed. The number of alloc is not same as the strata.</p>
  
  <pre><code>proc surveyselect data=example out=test sampsize=10;
  strata group score/alloc=(0.5 0.2 0.3);
  run;
  </code></pre>