<?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: Macros variable in date parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macros-variable-in-date-parameter/m-p/320161#M70467</link>
    <description>&lt;P&gt;What does the SAS log tell you? Any warnings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say your macro variable is &amp;amp;year but then you use a macro variable&amp;nbsp;&lt;SPAN&gt;&amp;amp;aat_year_ty in your code. Which one is the correct name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following should work:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%let year&amp;nbsp;= 2016;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where date = "01AUG&amp;amp;year"d;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2016 10:01:00 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2016-12-20T10:01:00Z</dc:date>
    <item>
      <title>Macros variable in date parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-variable-in-date-parameter/m-p/320159#M70465</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a macros variable for year defined by&amp;nbsp;%let year&amp;nbsp;= 2016;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to use this within a date parameter as below but I can't seem to amend my code so it works. At the moment I am getting 0 records where as if I run without the macros variable and just use 2016 instead it returns records. How can I adjust so this works?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where date = "01AUG&amp;amp;aat_year_ty."d;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(0 records returned)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;set &lt;/SPAN&gt;&lt;SPAN&gt;have&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where date = '01AUG2016'd;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(300 rows)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 09:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-variable-in-date-parameter/m-p/320159#M70465</guid>
      <dc:creator>troopon</dc:creator>
      <dc:date>2016-12-20T09:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macros variable in date parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-variable-in-date-parameter/m-p/320161#M70467</link>
      <description>&lt;P&gt;What does the SAS log tell you? Any warnings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say your macro variable is &amp;amp;year but then you use a macro variable&amp;nbsp;&lt;SPAN&gt;&amp;amp;aat_year_ty in your code. Which one is the correct name.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The following should work:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;%let year&amp;nbsp;= 2016;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;where date = "01AUG&amp;amp;year"d;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 10:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-variable-in-date-parameter/m-p/320161#M70467</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2016-12-20T10:01:00Z</dc:date>
    </item>
  </channel>
</rss>

