title: Force append in SAS to save missing data
body: <p>I am trying to save a vector named <code>ez</code> product of some matrix calculations based on a group variable named <code>ID_bloque</code>. For each <code>ID_bloque</code> value my code computes a vector called <code>ez</code> and append it in a matrix with the same name. However, if <code>zk</code> is a missing data vector (which is not a mistake) the code stops and make no other computations, which is a problem for other groups since no calculations are made for them. Is there any way to force <code>append</code> clause to keep this data and those resulting for the other groups? Thank you so much</p>
  
  <pre><code>proc iml;
  /*Maximo= maximum ID_bloque value*/
  do i=1 to %EVAL(&amp;MAXIMO);
       use T6; /*Dataset*/
       /*Variables*/
       read all var{E1S1 E1S2 E2S1 E2S2 E3S1 E3S2 E4S1 E4S2} 
                                       into XK where (ID_bloque=i) ;
       read all var{FEX_P} into dk where (ID_bloque=i) ;
       read all var{VK} into vk where (ID_bloque=i) ;
       read all var{z} into zk where (ID_bloque=i) ;
       /* Matrix computations */
       MAT=J(NCOL(XK),NCOL(XK),0);
       do j=1 to Nrow(XK);
            MAT= MAT + dk[j]*vk[j]*((XK[j,]`)*XK[j,]);
       end;
       /* ez values depending on missing information in zk*/
       if all(zk)=. then do;
            ez=zk;
       end;
       else do;
            Brz=(Ginv(MAT))*((XK`)*(dk#vk#zk));
            ez=zk-XK*Brz;
       end;
       /* Vectors appending (error source) */
       if i=1 then do;
            create ez var{ez}; APPEND;
       end;else do; APPEND var{ez} ;end;
  end;
  close ez;
  quit;
  </code></pre>