title: Lookup for the first non-zero value in SAS
body: <p>If I have a data of 1's and 0's how can I return the variables with the first non-zero value in each row (Hlookup-in excel). Below is an example of the data and output needed. Any help would be appreciated. Thanks.</p>
  
  <pre><code>    a b c d output
  p   1 0 0 0   a
  q   0 0 1 1   c
  r   0 1 0 0   b
  s   0 0 0 1   d
  </code></pre>