title: Multiple Conditions/variables in an IF-THEN statement SAS
body: <p>I have a data set which has two variables I'm trying to create new groups from. The first variable is "religiosity" and the second is "Av_Anti", both are numeric variables. I'm trying to create groups to separate into 9 groups, with low/mid/high religiosity AND low/mid/high Av_Anti. </p>
  
  <pre><code>DATA LYING1;
  SET LYING;
      IF RELIGIOSITY = (1 OR 2) AND Av_anti &lt;=3 THEN Rel_Anti = "LowR,LowA";
      IF RELIGIOSITY = (1 OR 2) AND Av_anti (&gt;3 AND &lt;=7) THEN Rel_Anti = "LowR,MidA";
      IF RELIGIOSITY = (1 OR 2) AND Av_anti &gt;7 THEN Rel_Anti = "LowR,HighA";
      IF RELIGIOSITY = (3 OR 4 OR 5) AND Av_anti &lt;=3 THEN Rel_Anti = "MidR,LowA";
      IF RELIGIOSITY = (3 OR 4 OR 5) AND Av_anti (&gt;3 AND &lt;=7) THEN Rel_Anti = "MidR,MidA";
      IF RELIGIOSITY = (3 OR 4 OR 5) AND Av_anti &gt;7 THEN Rel_Anti = "MidR,HighA";
      IF RELIGIOSITY = (6 OR 7) AND Av_anti &lt;=3 THEN Rel_Anti = "HighR,LowA";
      IF RELIGIOSITY = (6 OR 7) AND Av_anti (&gt;3 AND &lt;=7) THEN Rel_Anti = "HighR,MidA";
      IF RELIGIOSITY = (6 OR 7) AND Av_anti &gt;7 THEN Rel_Anti = "HighR,HighA";
      ELSE Rel_Anti = "Error";
  RUN;
  </code></pre>
  
  <p>I keep getting the message </p>
  
  <pre><code>  "The function AV_ANTI is unknown, or cannot be accessed." 
  </code></pre>
  
  <p>The thing is, I've checked that variable, its spelled correctly and its listed in the called dataset. I don't know why SAS wouldn't be recognizing it as a variable? I also seem to be getting some issues with the logical operators (the >, &lt;=). Am I missing something?</p>