title: Impute missing values by Replicating Previous Value
body: <p>My data is in this format:</p>
  
  <pre><code>Var1  Var1  Var1 Value1 Imputer_Value1  Value2  Imputer_Value2
      A   A1  A11 6   6   15  15
      A   A1  A11 9   9   14  14
      A   A1  A12 1   1   19  19
      A   A2  A12     1   16  16
      A   A2  A13 10  10  13  13
      A   A2  A13 4   4   .   13
      B   B1  B11 8   8   13  13
      B   B1  B11 9   9   17  17
      B   B1  B12 5   5   18  18
      B   B2  B12 .   5   12  12
      B   B2  B13 2   2   20  20
      B   B2  B13 1   1   .   20
  </code></pre>
  
  <p>I want to impute the missing values by replicating the previous value from the same above group. Can anyone please tell me how to do it? I tried to follow this option. But this does not have multiple value computation option.</p>
  
  <pre><code>data imputedData;
   set mydata;
   n=_n_;
   if missing(Value1) then
    do;
     do until (not missing(value1));
       n=n-1;
       set mydata(keep=Value1) point=n;  *second SET statement;
     end;
   end;
  run;
  </code></pre>
  
  <p>Thanks!</p>