<?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: Expression using equals (=) has components that are of different data types) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390408#M66131</link>
    <description>&lt;P&gt;You miss semicolons on all lines executing the macro. It should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%eventsum(period=2013);
%eventsum(period=2014);
%eventsum(period=2015);
%eventsum(period=2016);
%eventsum(period=2017);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, if have semicolons and this is just typo on post,&lt;/P&gt;
&lt;P&gt;then probably PERIOD is defined as charcter and you have to code execution like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%eventsum(period='2013');
%eventsum(period='2014');
%eventsum(period='2015');
%eventsum(period='2016');
%eventsum(period='2017');&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 23 Aug 2017 20:04:24 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-08-23T20:04:24Z</dc:date>
    <item>
      <title>Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390405#M66130</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get the above error message (&lt;U&gt;Error: Expression using equals (=) has components that are of different data types&lt;/U&gt;) upon running the following code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MACRO eventsum(period=);&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table disease_standard as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select year, age_group, sex, disease&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from&amp;nbsp;dataset_name&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;where disease=1 and year=&amp;amp;period;&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%MEND eventsum;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%eventsum(period=2013)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%eventsum(period=2014)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%eventsum(period=2015)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%eventsum(period=2016)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%eventsum(period=2017)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure what the error message means, and how to go about fixing it. Any help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 19:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390405#M66130</guid>
      <dc:creator>Jack_Smitherson</dc:creator>
      <dc:date>2017-08-23T19:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390408#M66131</link>
      <description>&lt;P&gt;You miss semicolons on all lines executing the macro. It should be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%eventsum(period=2013);
%eventsum(period=2014);
%eventsum(period=2015);
%eventsum(period=2016);
%eventsum(period=2017);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, if have semicolons and this is just typo on post,&lt;/P&gt;
&lt;P&gt;then probably PERIOD is defined as charcter and you have to code execution like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%eventsum(period='2013');
%eventsum(period='2014');
%eventsum(period='2015');
%eventsum(period='2016');
%eventsum(period='2017');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:04:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390408#M66131</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-08-23T20:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390411#M66132</link>
      <description>&lt;P&gt;Check your variable types for the two variables in your WHERE clause. If either are character they require quotes around the values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where disease='1' and year=&amp;amp;period&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where disease=1 and year="&amp;amp;period"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or possibly both combined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390411#M66132</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-23T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390416#M66133</link>
      <description>Thanks for the response. When I make the suggested modifications to the SAS&lt;BR /&gt;code (added single quotes and semicolons), I get the following error codes:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*ERROR 22-322: Syntax error, expecting one of the following: (, AS, LIKE.*&lt;BR /&gt;&lt;BR /&gt;*ERROR 200-322: The symbol is not recognized and will be ignored.*&lt;BR /&gt;&lt;BR /&gt;Not sure why I continue to get error messages...&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:24:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390416#M66133</guid>
      <dc:creator>Jack_Smitherson</dc:creator>
      <dc:date>2017-08-23T20:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390418#M66134</link>
      <description>&lt;P&gt;Post your new code and log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, a proc contents on your data set as well, unless you're sure you've corrected the type issue already.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 20:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390418#M66134</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-08-23T20:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Expression using equals (=) has components that are of different data types)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390800#M66152</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier"&gt;proc &lt;/FONT&gt;sql&lt;FONT face="courier new,courier"&gt;; describe table dataset_name;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the log will show you the data structure;&lt;/P&gt;&lt;P&gt;use quotes accordingly&lt;/P&gt;&lt;P&gt;as noted by an earlier responder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ron Fehd&amp;nbsp; data structure!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Aug 2017 01:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Error-Expression-using-equals-has-components-that-are-of/m-p/390800#M66152</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2017-08-25T01:22:11Z</dc:date>
    </item>
  </channel>
</rss>

