<?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 Macro date does not resolve in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803442#M316355</link>
    <description>&lt;P&gt;I am using enterprise guide 8.2 and SAS 9.4&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt; cycle (name, mo);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table &amp;amp;mo AS&lt;/P&gt;
&lt;P&gt;select a.creditaccountid, b.statusreasoncode as src_&amp;amp;name, c.externalstatuscode as esc_&amp;amp;name&lt;/P&gt;
&lt;P&gt;from newdw.factfinancialmonthly a left join newdw.dimstatusreason b ON a.dimstatusreasonid=b.dimstatusreasonid&lt;/P&gt;
&lt;P&gt;left join newdw.dimexternalstatus c ON a.dimexternalstatusID=c.dimexternalstatusID&lt;/P&gt;
&lt;P&gt;where reportingdate eq &lt;STRONG&gt;"&amp;amp;mo"d&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and activeaccountindicator= &lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;EM&gt;cycle&lt;/EM&gt;&lt;/STRONG&gt; ('jan22',&lt;STRONG&gt;'31jan2022'd&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR MESSAGE&lt;/P&gt;
&lt;P&gt;'31jan2022'd&lt;/P&gt;
&lt;P&gt;ERROR22-322: Syntax error, expecting one of the following: a name, a quoted string.&amp;nbsp; ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2022 19:22:11 GMT</pubDate>
    <dc:creator>pangea17</dc:creator>
    <dc:date>2022-03-22T19:22:11Z</dc:date>
    <item>
      <title>Macro date does not resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803442#M316355</link>
      <description>&lt;P&gt;I am using enterprise guide 8.2 and SAS 9.4&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt; cycle (name, mo);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; table &amp;amp;mo AS&lt;/P&gt;
&lt;P&gt;select a.creditaccountid, b.statusreasoncode as src_&amp;amp;name, c.externalstatuscode as esc_&amp;amp;name&lt;/P&gt;
&lt;P&gt;from newdw.factfinancialmonthly a left join newdw.dimstatusreason b ON a.dimstatusreasonid=b.dimstatusreasonid&lt;/P&gt;
&lt;P&gt;left join newdw.dimexternalstatus c ON a.dimexternalstatusID=c.dimexternalstatusID&lt;/P&gt;
&lt;P&gt;where reportingdate eq &lt;STRONG&gt;"&amp;amp;mo"d&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;and activeaccountindicator= &lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;QUIT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;%&lt;STRONG&gt;&lt;EM&gt;cycle&lt;/EM&gt;&lt;/STRONG&gt; ('jan22',&lt;STRONG&gt;'31jan2022'd&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ERROR MESSAGE&lt;/P&gt;
&lt;P&gt;'31jan2022'd&lt;/P&gt;
&lt;P&gt;ERROR22-322: Syntax error, expecting one of the following: a name, a quoted string.&amp;nbsp; ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 19:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803442#M316355</guid>
      <dc:creator>pangea17</dc:creator>
      <dc:date>2022-03-22T19:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Macro date does not resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803444#M316356</link>
      <description>&lt;P&gt;When you run a macro, all macro variables are replaced by their value. So your macro actually runs this code that I am showing you. This code must be legal valid working SAS code, and it is not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;      

create     table &lt;STRONG&gt;'31jan2022'd&lt;/STRONG&gt; AS

select a.creditaccountid, b.statusreasoncode as src_&lt;SPAN&gt;'jan22'&lt;/SPAN&gt;, c.externalstatuscode as esc_&lt;SPAN&gt;'jan22'&lt;/SPAN&gt;

from newdw.factfinancialmonthly a left join newdw.dimstatusreason b ON a.dimstatusreasonid=b.dimstatusreasonid

left join newdw.dimexternalstatus c ON a.dimexternalstatusID=c.dimexternalstatusID

where reportingdate eq "&lt;STRONG&gt;'31jan2022'd&lt;/STRONG&gt;"d

and activeaccountindicator= 1;

QUIT;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Can you see what the problem is here? What different parts of this code are not legal valid working SAS code? How would you fix it to make it legal valid working SAS code?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 19:30:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803444#M316356</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-03-22T19:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macro date does not resolve</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803455#M316362</link>
      <description>&lt;P&gt;The macro variable reference obviously did resolve.&amp;nbsp; If it did not resolve then you would have seen &amp;amp;mo in the error message instead of the value of MO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is it you are trying to do?&lt;BR /&gt;What is the SAS code you are trying to use the macro to generate?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 20:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-date-does-not-resolve/m-p/803455#M316362</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-22T20:39:51Z</dc:date>
    </item>
  </channel>
</rss>

