<?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: Expression using equals has components that are of different data types in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471147#M285715</link>
    <description>&lt;P&gt;they;re both fine, the error is on those two lines i've highlighted in red&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jun 2018 16:20:47 GMT</pubDate>
    <dc:creator>zjanuske</dc:creator>
    <dc:date>2018-06-18T16:20:47Z</dc:date>
    <item>
      <title>Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471142#M285711</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm running a proc sql table, trying to compare dates in the WHERE statement. I keep getting this error: "Expression using equals (=) has components that are of different data types.".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have run proc contents to compare formats of both variables, and they look the same:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 365px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21250iDDD1232488132E1C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 541px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21251i54B1BBB364B8CF12/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I'm running:&lt;/P&gt;&lt;PRE&gt;PROC SQL;
CREATE TABLE TRACKER_REDEMPTIONS AS SELECT t.*, r.redemptions FROM tracker_work4 T LEFT JOIN new_redemptionst r ON 
((T.STORE=r.store) AND 
(T.CAMPAIGN = r.campaign) AND 
&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;(T.start &amp;lt;= r.sunday)&lt;/FONT&gt;&lt;/STRONG&gt; AND
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;(T.'Last Expiry Date'n &amp;gt;= r.sunday)&lt;/STRONG&gt;&lt;/FONT&gt;) ;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm out of ideas for what could be wrong. Help!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 15:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471142#M285711</guid>
      <dc:creator>zjanuske</dc:creator>
      <dc:date>2018-06-18T15:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471143#M285712</link>
      <description>&lt;P&gt;You didn't show the contents for ALL of the variables shown in your statement, specifically t.start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also might run into a problem, albeit a different one, in that the lengths of t.campaign and r.campaign are different.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:12:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471143#M285712</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-06-18T16:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471144#M285713</link>
      <description>&lt;P&gt;t.start specifications are exactly the same as Last Expiry Date (or r.sunday). I'm currently only trying to solve the dates issue, not worrying about campaign length yet.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471144#M285713</guid>
      <dc:creator>zjanuske</dc:creator>
      <dc:date>2018-06-18T16:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471146#M285714</link>
      <description>&lt;P&gt;What about t.store and r.store?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471146#M285714</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-06-18T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471147#M285715</link>
      <description>&lt;P&gt;they;re both fine, the error is on those two lines i've highlighted in red&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471147#M285715</guid>
      <dc:creator>zjanuske</dc:creator>
      <dc:date>2018-06-18T16:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471149#M285716</link>
      <description>&lt;P&gt;Things not shown, that need to be checked:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;T.start ... is it character or numeric?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The global option VALIDVARNAME has to be set to ANY to permit name literals as field names.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471149#M285716</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-06-18T16:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471150#M285717</link>
      <description>&lt;P&gt;Post your log and the full proc contents of both datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 16:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471150#M285717</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-06-18T16:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Expression using equals has components that are of different data types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471168#M285718</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error might not be in the lines you highlighted in red as they are using comparison operators &lt;FONT face="courier new,courier"&gt;&amp;lt;=&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;&amp;gt;=&lt;/FONT&gt; which for the following different data types causes a different error message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   create table tmp as
   select a.*
         ,b.weight
   from sashelp.class(drop = weight) a
   left join sashelp.class b
   on a.name &amp;gt;= b.age
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;gives the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;14 proc sql noprint;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;15 create table tmp as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;16 select a.*&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;17 ,b.weight&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;18 from sashelp.class(drop = weight) a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;19 left join sashelp.class b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;20 on a.name &amp;gt;= b.age&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;21 ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;ERROR: Expression using greater than or equal (&amp;gt;=) has components that are of different data types.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;22 quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see it refers to &lt;FONT face="courier new,courier"&gt;greater than or equal (&amp;gt;=)&lt;/FONT&gt; not just &lt;FONT face="courier new,courier"&gt;equals (=)&amp;nbsp;&lt;/FONT&gt;which your message does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Changing my code to use &lt;FONT face="courier new,courier"&gt;=&lt;/FONT&gt; instead of &lt;FONT face="courier new,courier"&gt;&amp;gt;=&lt;/FONT&gt; gives the same error message as yours, so this indicates that the issue is with your equality tests &lt;FONT face="courier new,courier"&gt;T.STORE=r.store&lt;/FONT&gt; or &lt;FONT face="courier new,courier"&gt;T.CAMPAIGN = r.campaign&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As others have advised, seeing all the relevant information would help us to help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just another thought, are either of the data sets views?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 17:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Expression-using-equals-has-components-that-are-of-different/m-p/471168#M285718</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-06-18T17:17:01Z</dc:date>
    </item>
  </channel>
</rss>

