<?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: can't insert date macro into SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184555#M35009</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza is &lt;SPAN style="color: #ff00ff;"&gt;She&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jun 2014 15:02:28 GMT</pubDate>
    <dc:creator>Linlin</dc:creator>
    <dc:date>2014-06-04T15:02:28Z</dc:date>
    <item>
      <title>can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184548#M35002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greetings!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a beginner to Macro.&lt;/P&gt;&lt;P&gt;My date variable is string.&lt;/P&gt;&lt;P&gt;My original code is shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;%macro plan(year);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;PROC &lt;/SPAN&gt;&lt;STRONG style=": ; color: #000080; font-size: 10pt; font-family: Courier New;"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; pop_&amp;amp;year&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; b &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;inner&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; a.ID=b.ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Date between &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-12-31';&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;quit&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%plan(2013);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;It's not working. I tried ""&amp;amp;year"||"-01-01"", but it didn't work, either. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Please, help me out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I need to create 10 datasets:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;pop_2013:&amp;nbsp; &lt;/SPAN&gt;Date between &lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2013-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2013-12-31'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;pop_2012:&amp;nbsp; &lt;/SPAN&gt;Date between &lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2012-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2012-12-31'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;pop_2011:&amp;nbsp; &lt;/SPAN&gt;Date between &lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2011-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'2011-12-31'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;and so on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Courier New;"&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 02:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184548#M35002</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T02:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184549#M35003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Macro variables only resolve in double quotes, not single quotes.&amp;nbsp; "&amp;amp;year-01-01" which would be a character variable&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 02:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184549#M35003</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-04T02:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184550#M35004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I tried "&amp;amp;year-01-01", I got an error message, "Invalid column name"&amp;nbsp; '&amp;amp;year-01-01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried below, too, but I got different error messages:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;""&amp;amp;year-01-01"" : An object or column name is missing&lt;/P&gt;&lt;P&gt;"'&amp;amp;year-01-01'"&amp;nbsp;&amp;nbsp; : Invalid column name&amp;nbsp;&amp;nbsp; ' '&amp;amp;year-01-01' '&lt;/P&gt;&lt;P&gt;' "&amp;amp;year-01-01" ' : Conversion failed when converting date or time from character&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:34:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184550#M35004</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T13:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184551#M35005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to specify its a date:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; Date between &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-12-31';&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; Date between "&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&amp;amp;year-01-01"d&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; "&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&amp;amp;year-12-31"d;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:43:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184551#M35005</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-04T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184552#M35006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To note, you could also achieve the end result by (not-tested):&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=2001 to 2013;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year=put(i,4.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&amp;nbsp; proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table POP_'||year||' as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp; B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; inner join A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A.ID=B.ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&amp;nbsp;&amp;nbsp; date between '||input(year||'-01-01',yymmdd10.)||' and '||input(year||'-12-31',yymmdd10.)||';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit');&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184552#M35006</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-04T13:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184553#M35007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;presuming date is actually a date...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;create&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; pop_&amp;amp;year&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; b &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;inner&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;join&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; a&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;on&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; a.ID=b.ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; Date between "&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;01Jan&amp;amp;year."d&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; "31Dec&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&amp;amp;year."d;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;quit&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 13:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184553#M35007</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2014-06-04T13:53:14Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184554#M35008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Withus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Reeza suggested this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where date between "&amp;amp;year-01-01" and "&amp;amp;year-12-31"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you realize that he is using double quotes, and not two single quotes?&amp;nbsp; Did you actually use double quotes and have the program still fail?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 14:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184554#M35008</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2014-06-04T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184555#M35009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza is &lt;SPAN style="color: #ff00ff;"&gt;She&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184555#M35009</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2014-06-04T15:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184556#M35010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sory to add to your mail Astounding, you would still need to have the letter d after your date literals, e.g. "&amp;amp;year-01-01"d&lt;/P&gt;&lt;P&gt;Otherwise the where is trying to compare numeric date to two characters which wont work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184556#M35010</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-04T15:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184557#M35011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The OP states it's a character variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;My date variable is string.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184557#M35011</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-04T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184558#M35012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the where is all wrong then:&lt;/P&gt;&lt;P&gt;from:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; Date between &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-01-01'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;'&amp;amp;year-12-31';&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to (assuming per the other dates that my date is yyyy-mm-dd):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;where&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; input(Date,yymmdd10.) between "&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&amp;amp;year-01-01"d&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;and&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt; "&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&lt;SPAN style="color: #800080; font-family: Courier New; font-size: 10pt; text-decoration: underline;"&gt;&amp;amp;year-12-31"d;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184558#M35012</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-04T15:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184559#M35013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got an error.&lt;/P&gt;&lt;P&gt;without data it may be hard to test the code.&lt;/P&gt;&lt;P&gt;Here are fake data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data family;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input @1 ID $1. @3 DOS $11. @15 day 2.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;A 2011-01-05 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;A 2012-01-05 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;A 2013-01-05 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;B 2013-12-25 13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;B 2012-12-25 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;B 2011-12-25 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;C 2011-11-15 9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;C 2012-11-15 10&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;C 2013-11-15 11&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data school;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;infile datalines;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;input @1 ID $1. @3 edu 2.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;datalines;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;A 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;B 12&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;C 19&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&lt;SPAN style="text-decoration: underline;"&gt;Without macro or do loop, this worked&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;create table pop_2013 as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;select a.*, b.edu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;from family a inner join school b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;on a.ID=b.ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;where DOS between '2013-01-01' and '2013-12-31';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I&lt;SPAN style="text-decoration: underline;"&gt; tried your do loop, but I got an error message&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;do i=2011 to 2013;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;year=put(i, 4.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;call execute('proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;create table pop_'||year||' as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;select a.*, b.edu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;from family a inner join school b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;on a.ID=b.ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;where DOS between '||input(year||'-01-01', yymmdd10.) and '||input(year||'-12-31', yymmdd10.)||';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;quit');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;I tried macro, but I got an error message, too.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;%macro year(year);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;create table pop_&amp;amp;year as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;select a.*, b.edu&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;from family a inner join school b&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;on a.ID=b.ID&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;where DOS between "&amp;amp;year-01-01" and "&amp;amp;year-12-31";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It didn't work. I tried more using macro so far:&lt;/P&gt;&lt;P&gt;"&amp;amp;year-01-01"&lt;/P&gt;&lt;P&gt;""&amp;amp;year-01-01""&lt;/P&gt;&lt;P&gt;" '&amp;amp;year-01-01' "&lt;/P&gt;&lt;P&gt;' "&amp;amp;year-01-01" '&lt;/P&gt;&lt;P&gt;' "&amp;amp;year||"-01-01" '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Any advice?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184559#M35013</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T15:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184560#M35014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, there are some typos in your code for the data _null_ suggestion, here it is updated:&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; do i=2011 to 2013;&lt;BR /&gt;&amp;nbsp; year=put(i, 4.);&lt;BR /&gt;&amp;nbsp; call execute('proc sql;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table pop_'||year||' as&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*, b.edu&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from family a inner join school b&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on a.ID=b.ID&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where input(DOS,yymmdd10.) between '||input(year||'-01-01', yymmdd10.)||' and '||input(year||'-12-31', yymmdd10.)||';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quit;');&lt;BR /&gt;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your macro isn't working as the DOS is still character and needs to be input as YYMMDD10., also the other dates need d after them to make them date literals.&amp;nbsp; Please see my other post for the where clause update.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184560#M35014</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-06-04T15:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184561#M35015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried, shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"input(DOS, yymmdd10.)" then I got an error message: Invalid date/time "2013-01-01"d&lt;/P&gt;&lt;P&gt;"01Jan&amp;amp;year."d.&amp;nbsp;&amp;nbsp;&amp;nbsp; ....and another error: different data types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your convenience I posted fake data and code above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184561#M35015</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T15:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184562#M35016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't have to do the input conversion, though perhaps you should.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data family;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input @1 ID $1. @3 DOS $11. @15 day 2.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 2011-01-05 11&lt;/P&gt;&lt;P&gt;A 2012-01-05 10&lt;/P&gt;&lt;P&gt;A 2013-01-05 12&lt;/P&gt;&lt;P&gt;B 2013-12-25 13&lt;/P&gt;&lt;P&gt;B 2012-12-25 12&lt;/P&gt;&lt;P&gt;B 2011-12-25 11&lt;/P&gt;&lt;P&gt;C 2011-11-15 9&lt;/P&gt;&lt;P&gt;C 2012-11-15 10&lt;/P&gt;&lt;P&gt;C 2013-11-15 11&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data school;&lt;/P&gt;&lt;P&gt;infile datalines;&lt;/P&gt;&lt;P&gt;input @1 ID $1. @3 edu 2.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;A 5&lt;/P&gt;&lt;P&gt;B 12&lt;/P&gt;&lt;P&gt;C 19&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro by_year(year);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table pop_&amp;amp;year as&lt;/P&gt;&lt;P&gt;select a.*, b.edu&lt;/P&gt;&lt;P&gt;from family a inner join school b&lt;/P&gt;&lt;P&gt;on a.ID=b.ID&lt;/P&gt;&lt;P&gt;where DOS between "&amp;amp;year.-01-01" and "&amp;amp;year.-12-31";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%by_year(2013);&lt;/P&gt;&lt;P&gt;%by_year(2012);&lt;/P&gt;&lt;P&gt;%by_year(2011);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:24:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184562#M35016</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-06-04T15:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184563#M35017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still got an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: CALL EXECUTE generate line.&lt;/P&gt;&lt;P&gt;call execute('proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table pop_'||year||' &lt;SPAN style="text-decoration: underline;"&gt;asselect&lt;/SPAN&gt; a.*, b.edu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax error, expecting one of the follow: (, '.', AS, LIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on the code, there is space between "as" and "select".&lt;/P&gt;&lt;P&gt;Thus, I changed line between them, but I still got an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:29:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184563#M35017</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T15:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184564#M35018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks from your examples like it seems to make a difference whether you includes the strings that look like dates in single or double quotes.&lt;/P&gt;&lt;P&gt;So it sounds like you are not using the code your originally posted but are instead using explicit passthrough to submit SQL code to a remote database that interprets strings in double quotes as variable or table names and strings in single quotes as literals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To generate strings in single quotes you could use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-style: inherit; background-color: #ffffff; font-family: 'Courier New'; text-decoration: underline; font-weight: inherit;"&gt;where&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt; Date between %unquote(%str(%&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-style: inherit; background-color: #ffffff; font-family: 'Courier New'; text-decoration: underline; font-weight: inherit;"&gt;')&amp;amp;year-01-01%str(%'))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-style: inherit; background-color: #ffffff; font-family: 'Courier New'; text-decoration: underline; font-weight: inherit;"&gt;and&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: 'Courier New'; background-color: #ffffff;"&gt; %unquote(%str(%&lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-style: inherit; background-color: #ffffff; font-family: 'Courier New'; text-decoration: underline; font-weight: inherit;"&gt;')&amp;amp;year-12-31%str(%'))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184564#M35018</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-06-04T15:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184565#M35019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the log. Not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;create table pop_2013 as&lt;/P&gt;&lt;P&gt;select a.*, b.edu&lt;/P&gt;&lt;P&gt;from family a inner join school b&lt;/P&gt;&lt;P&gt;on a.ID=b.ID 870&amp;nbsp; where DOS&amp;nbsp; between '2013-01-01' and '2013-12-31';&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.POP_2013 created, with 5 rows and 4 columns.&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;%macro year(year);&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table pop_&amp;amp;year as&lt;/P&gt;&lt;P&gt;select a.*, b.edu&lt;/P&gt;&lt;P&gt;from family a inner join school b&lt;/P&gt;&lt;P&gt;on a.ID=b.ID 878&amp;nbsp; where DOS&amp;nbsp; between '&amp;amp;year.-01-01' and '&amp;amp;year.-12-31';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend; 881&amp;nbsp; %year(2013);&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.POP_2013 created, with 0 rows and 4 columns.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184565#M35019</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T15:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184566#M35020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear withus,&lt;/P&gt;&lt;P&gt;The SQL macro suggestion above is working for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;292&lt;/P&gt;&lt;P&gt;293 %yeary(yeary=2013);&lt;/P&gt;&lt;P&gt;MPRINT(YEARY): proc sql;&lt;/P&gt;&lt;P&gt;MPRINT(YEARY): create table pop_2013 as select a.*, b.edu from family a inner join school b on a.ID=b.ID where DOS&lt;/P&gt;&lt;P&gt;between "2013-01-01" and "2013-12-31";&lt;/P&gt;&lt;P&gt;NOTE: Table WORK.POP_2013 created, with 3 rows and 4 columns.&lt;/P&gt;&lt;P&gt;MPRINT(YEARY): quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"yeary = 2013"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code worked all the way through for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; options macrogen mprint;&lt;BR /&gt; %global chkit;&lt;BR /&gt;%macro yearz(year);&lt;BR /&gt;proc sql;&lt;BR /&gt;create table pop_&amp;amp;year. as&lt;/P&gt;&lt;P&gt;select a.*, b.edu&lt;/P&gt;&lt;P&gt;from family a inner join school b&lt;/P&gt;&lt;P&gt;on a.ID=b.ID&lt;/P&gt;&lt;P&gt;where DOS between "&amp;amp;year.-01-01" and "&amp;amp;year.-12-31";&lt;/P&gt;&lt;P&gt;quit;&lt;BR /&gt;%put "year = &amp;amp;year.";&lt;BR /&gt;%put "chkit = &amp;amp;chkit.";&lt;BR /&gt;%mend yearz;&lt;/P&gt;&lt;P&gt;%let chkit=2013;&lt;BR /&gt;%yearz(&amp;amp;chkit.);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc print data=work.pop_&amp;amp;chkit.;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184566#M35020</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2014-06-04T15:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: can't insert date macro into SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184567#M35021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank YOU so much. It worked beautifully.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2014 15:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/can-t-insert-date-macro-into-SQL/m-p/184567#M35021</guid>
      <dc:creator>withus</dc:creator>
      <dc:date>2014-06-04T15:45:36Z</dc:date>
    </item>
  </channel>
</rss>

