<?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 how to solve this problem? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-solve-this-problem/m-p/552399#M9185</link>
    <description>&lt;PRE&gt;%macro accountreport(State=);&lt;BR /&gt;proc sql;&lt;BR /&gt;title "&amp;amp;title";&lt;BR /&gt;create table mydata as&lt;BR /&gt;select Acct_ID,Name,birthday format ddmmyy8.0,Sex,State format $char8.,Cust_Type,Product,Balance,Last_Tran_Date=symget('tran_date')&lt;BR /&gt;from myprj2.profile2;&lt;BR /&gt;quit;&lt;BR /&gt;%mend accountreport;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc content of the data is attached..&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 19 Apr 2019 07:50:57 GMT</pubDate>
    <dc:creator>Sathiskumar_D</dc:creator>
    <dc:date>2019-04-19T07:50:57Z</dc:date>
    <item>
      <title>how to solve this problem?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-solve-this-problem/m-p/552399#M9185</link>
      <description>&lt;PRE&gt;%macro accountreport(State=);&lt;BR /&gt;proc sql;&lt;BR /&gt;title "&amp;amp;title";&lt;BR /&gt;create table mydata as&lt;BR /&gt;select Acct_ID,Name,birthday format ddmmyy8.0,Sex,State format $char8.,Cust_Type,Product,Balance,Last_Tran_Date=symget('tran_date')&lt;BR /&gt;from myprj2.profile2;&lt;BR /&gt;quit;&lt;BR /&gt;%mend accountreport;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;SPAN&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc content of the data is attached..&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 07:50:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-solve-this-problem/m-p/552399#M9185</guid>
      <dc:creator>Sathiskumar_D</dc:creator>
      <dc:date>2019-04-19T07:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to solve this problem?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-solve-this-problem/m-p/552406#M9187</link>
      <description>&lt;OL&gt;
&lt;LI&gt;always make sure that your Base SAS code works before putting it in a macro&lt;/LI&gt;
&lt;LI&gt;your macro is totally useless, as the macro parameter is never used in the macro, therefore remove the macro definition. You don't need it.&lt;/LI&gt;
&lt;LI&gt;this causes your problem:&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;Last_Tran_Date=symget('tran_date')&lt;/PRE&gt;
&lt;P&gt;When used in the select (and not in a where), it will result either in a zero (condition not met) or a 1 (condition is met).&lt;/P&gt;
&lt;P&gt;BUT: last_tran_date is numeric, while the result of the symget() function is always of type character, and proc sql does not do type conversions on the fly (as the data step does), so this can't work.&lt;/P&gt;
&lt;P&gt;You need to convert the result of your symget() to a proper SAS date value, and I guess you wanted this condition to be part of a where clause. How you convert depends on the contents of &amp;amp;tran_date.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2019 08:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-solve-this-problem/m-p/552406#M9187</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-04-19T08:17:48Z</dc:date>
    </item>
  </channel>
</rss>

