<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ERROR: WHERE clause operator requires compatible variables. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967825#M376447</link>
    <description>&lt;P&gt;Have you tried:&lt;/P&gt;
&lt;P&gt;where var='1';&lt;/P&gt;
&lt;P&gt;Can you send a PROC CONTENTS of the Total data set?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=total;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 May 2025 16:22:21 GMT</pubDate>
    <dc:creator>Kathryn_SAS</dc:creator>
    <dc:date>2025-05-30T16:22:21Z</dc:date>
    <item>
      <title>ERROR: WHERE clause operator requires compatible variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967824#M376446</link>
      <description>&lt;P&gt;I want to filter the data based on a where statement. The code is quite simple.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
set total;
where var = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I got the wrong message&lt;/P&gt;
&lt;P&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/P&gt;
&lt;P&gt;I check var is numeric variable&lt;/P&gt;
&lt;P&gt;Please help me figure out this issue. Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 16:16:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967824#M376446</guid>
      <dc:creator>SeaMoon_168</dc:creator>
      <dc:date>2025-05-30T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: WHERE clause operator requires compatible variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967825#M376447</link>
      <description>&lt;P&gt;Have you tried:&lt;/P&gt;
&lt;P&gt;where var='1';&lt;/P&gt;
&lt;P&gt;Can you send a PROC CONTENTS of the Total data set?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=total;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 May 2025 16:22:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967825#M376447</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-05-30T16:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: WHERE clause operator requires compatible variables.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967826#M376448</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/382088"&gt;@SeaMoon_168&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to filter the data based on a where statement. The code is quite simple.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sample;
set total;
where var = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;However, I got the wrong message&lt;/P&gt;
&lt;P&gt;ERROR: WHERE clause operator requires compatible variables.&lt;/P&gt;
&lt;P&gt;I check var is numeric variable&lt;/P&gt;
&lt;P&gt;Please help me figure out this issue. Thanks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I doubt that SAS is wrong here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you checked the right TOTAL dataset.&amp;nbsp; Single level names normally mean WORK datasets.&amp;nbsp; But if you defined a USER libref or used the USER system option to select some other libref to use for one character names then SAS might.&amp;nbsp; Because of the error with the WHERE statement the SAS log will not help you since it will not show what actual dataset it attempted to read from.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also check if TOTAL is a VIEW instead of a dataset.&amp;nbsp; In that case it might be using a WHERE statement (or WHERE= dataset option) that references some other variable and that is the source of the error.&amp;nbsp; Although that would normally provide more information.&lt;/P&gt;
&lt;PRE&gt;59   data want ;
60    set class_v;
ERROR: Variable var has been defined as both character and numeric.
ERROR: WHERE clause operator requires compatible variables.
ERROR: Failure loading view WORK.CLASS_V.VIEW.
       Error detected during View Load request.
61    where name='Alfred';
62   run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 May 2025 16:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/ERROR-WHERE-clause-operator-requires-compatible-variables/m-p/967826#M376448</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-30T16:54:24Z</dc:date>
    </item>
  </channel>
</rss>

