title: SAS Same logical applied to a list of variables?
body: <p>I'm trying to apply the same logical on all the variables and create a new variable based on the logical:</p>
  
  <pre><code>DATA want;
      SET have;
      IF "range" = 25 THEN "new range" = 1
          ELSE "new range" = 0;
  RUN;
  </code></pre>
  
  <p>If it's easier I can also just change the variables themselves as opposed to creating new variables from the logical statement.</p>
  
  <p>As an example, I want any value within the variables of 25 to be 1, and everything else to be 0:</p>
  
  <p>HAVE:</p>
  
  <pre><code>var_100     var_101     var_102
  30          25          20
  45          100         25
  25          25          10
  </code></pre>
  
  <p>WANT:</p>
  
  <pre><code>var_100     var_101     var_102
  0          1            0
  0          0            1
  1          1            0
  </code></pre>
  
  <p>So I have about 100 variables with all the same prefix and increasing suffices. Instead of writing 100 logicals. I am trying to write one that will apply to every variable in that range of var_1 to var_100. </p>