<?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 Reg Date Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59349#M12849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually i am having two tables and check the counts of two datasets based on dates i am doing in this way but i ma getting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;BR /&gt;How can i check the counts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data l;&lt;BR /&gt;input id date date9.;&lt;BR /&gt;format date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data l2;&lt;BR /&gt;input id date date9.;&lt;BR /&gt;format date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select max(date) format=date9. into:maxdt&amp;nbsp; from l2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(*) into:S1 from l;&lt;BR /&gt;select count(*) into:s2 from l2 where date="&amp;amp;maxdt.";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2012 07:27:51 GMT</pubDate>
    <dc:creator>sas_Forum</dc:creator>
    <dc:date>2012-04-10T07:27:51Z</dc:date>
    <item>
      <title>Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59349#M12849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually i am having two tables and check the counts of two datasets based on dates i am doing in this way but i ma getting &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;BR /&gt;How can i check the counts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data l;&lt;BR /&gt;input id date date9.;&lt;BR /&gt;format date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data l2;&lt;BR /&gt;input id date date9.;&lt;BR /&gt;format date date9.;&lt;BR /&gt;cards;&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 12jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;2 13jan2012&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;select max(date) format=date9. into:maxdt&amp;nbsp; from l2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;select count(*) into:S1 from l;&lt;BR /&gt;select count(*) into:s2 from l2 where date="&amp;amp;maxdt.";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;ERROR: Expression using equals (=) has components that are of different data types.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 07:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59349#M12849</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-04-10T07:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59350#M12850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) into:s2 from l2 where date=&lt;STRONG&gt;"&amp;amp;maxdt."d&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 07:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59350#M12850</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-10T07:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59351#M12851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thqs Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 07:55:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59351#M12851</guid>
      <dc:creator>sas_Forum</dc:creator>
      <dc:date>2012-04-10T07:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59352#M12852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i guess .(dot) after maxdt is not required.Not sure incase i am wrong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 08:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59352#M12852</guid>
      <dc:creator>manojinpec</dc:creator>
      <dc:date>2012-04-10T08:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59353#M12853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are right. It doesn't matter whether the dot is there.&lt;/P&gt;&lt;P&gt;the same result will be .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 08:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59353#M12853</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-04-10T08:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reg Date Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59354#M12854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another approach, not as slick of course, is to remove 'format=' and convert the date variable into numeric digits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select max(date) into:maxdt from l2;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select count(*) into:S1 from l;&lt;/P&gt;&lt;P&gt;select count(*) into:s2 from l2 where date=input("&amp;amp;maxdt.",20.);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or keep the format and then use informat to convert:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select count(*) into:S1 from l;&lt;/P&gt;&lt;P&gt;select count(*) into:s2 from l2 where date=input("&amp;amp;maxdt.",date9.);&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 11:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reg-Date-Macro/m-p/59354#M12854</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-04-10T11:41:59Z</dc:date>
    </item>
  </channel>
</rss>

