<?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: using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24203#M4051</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add in the missing right paren at the end of the statement to close the symputx function call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;call symputx&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;cats('D',i&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;, put( &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;intnx(&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;'month',&amp;amp;month2,-1*i) , date9.) );&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;For 2 digit year problems check &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Year_2000_problem" style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;http://en.wikipedia.org/wiki/Year_2000_problem&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Jan 2012 19:16:20 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-01-04T19:16:20Z</dc:date>
    <item>
      <title>using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24198#M4046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello this is my first post:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a date variable to run a report for each month going back 24 months without having to manually put in the dates. I wrote this code but I am getting a &lt;/P&gt;&lt;P&gt;&lt;EM&gt;Warning: Apparent symbolic reference D1 not resolve&lt;/EM&gt;... etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let&amp;nbsp; &lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;month2 = '01AUG11'd;&lt;/SPAN&gt;&lt;/P&gt;&lt;STRONG style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;STRONG style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;%macro&lt;/P&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;/STRONG&gt;&lt;/STRONG&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&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&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 10pt;"&gt;&lt;STRONG&gt;&lt;EM&gt;mr_T&lt;/EM&gt;; &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;%do&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; i = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;1 %to 24:&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;﻿proc sql noprint;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt;﻿&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select intnx('month', &amp;amp;&amp;amp;month2, -&amp;amp;i) format=date7. into :d&amp;amp;&amp;amp;i from temp; quit;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;%end; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;﻿&lt;/STRONG&gt;&lt;/SPAN&gt;%mr_t;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 10pt;"&gt;&lt;SPAN style="color: #000080; font-size: 10pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 17:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24198#M4046</guid>
      <dc:creator>Arum</dc:creator>
      <dc:date>2012-01-04T17:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24199#M4047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use DATE9 instead of DATE7 to avoid confusion.&lt;/P&gt;&lt;P&gt;You have a colon after your %DO instead of a semi-colon .&lt;/P&gt;&lt;P&gt;You have not defined the D1, D2, ... macro variables as global. If they do not exist with the macro MR_T starts then they will disappear when it ends.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do not need macro code to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = 1 to 24 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symputx(cats('D',i),put(intnx('month',&amp;amp;month2,-1*i),date9.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 18:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24199#M4047</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-01-04T18:43:34Z</dc:date>
    </item>
    <item>
      <title>using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24200#M4048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to provide more info.&amp;nbsp; You have :s when you should have ;s, and you use &amp;amp;&amp;amp; where you probably only need &amp;amp;.&amp;nbsp; The following works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let&amp;nbsp; month2 = 01AUG11;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat date date7.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input date;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;01AUG11&lt;/P&gt;&lt;P&gt;01JUL11&lt;/P&gt;&lt;P&gt;01JUN11&lt;/P&gt;&lt;P&gt;01MAY11&lt;/P&gt;&lt;P&gt;01APR11&lt;/P&gt;&lt;P&gt;01FEB11&lt;/P&gt;&lt;P&gt;01JAN11&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro mr_T;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i = 1 %to 3;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proc print data=temp &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (where=(date eq intnx('month', "&amp;amp;month2"d, -&amp;amp;i.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%mr_t&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 18:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24200#M4048</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-01-04T18:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24201#M4049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; month2 = '01AUG11'd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; i = &lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt; &lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;24&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;v=intnx(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;'month'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;, &amp;amp;month2, -i);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;format&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; v &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;date7.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;set&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; symputx(cats(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;'d'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,strip(_n_)),put(v,&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: teal; font-size: 10pt;"&gt;date7.&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; _user_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;Linlin&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 19:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24201#M4049</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-01-04T19:05:52Z</dc:date>
    </item>
    <item>
      <title>using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24202#M4050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Thanks Tom I mistyped the colon after the %do instead of semi-colon. Why does date9 work better? Also I am trying to run the example you sent me, but it gives an error of 79-322 (expecting a). I will look at how to use your method, as I have been relying on Proc Sql to do this always.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let month2 = '01AUG11'd;&lt;/P&gt;&lt;P&gt;55 data _null_;&lt;/P&gt;&lt;P&gt;56 do i = 1 to 24 ;&lt;/P&gt;&lt;P&gt;57 call symputx(cats('D',i),put(intnx('month',&amp;amp;month2,-1*i),date9.);&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;79&lt;/P&gt;&lt;P&gt;ERROR 79-322: Expecting a ).&lt;/P&gt;&lt;P&gt;58 end;&lt;/P&gt;&lt;P&gt;59 run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 19:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24202#M4050</guid>
      <dc:creator>Arum</dc:creator>
      <dc:date>2012-01-04T19:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24203#M4051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add in the missing right paren at the end of the statement to close the symputx function call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;call symputx&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;cats('D',i&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;, put( &lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;intnx(&lt;/SPAN&gt;&lt;SPAN style="background-color: #eef4f9;"&gt;'month',&amp;amp;month2,-1*i) , date9.) );&lt;/SPAN&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;For 2 digit year problems check &lt;/SPAN&gt;&lt;A href="http://en.wikipedia.org/wiki/Year_2000_problem" style="font-family: monospace; white-space: pre; background-color: #ffffff;"&gt;http://en.wikipedia.org/wiki/Year_2000_problem&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 19:16:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24203#M4051</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-01-04T19:16:20Z</dc:date>
    </item>
    <item>
      <title>using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24204#M4052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This works great, thanks! I like the simplicity and it is perfect for creating the date variable needed.&amp;nbsp; I really like the trick to multiple i * -1. This just gave me an idea how to fix something else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 19:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24204#M4052</guid>
      <dc:creator>Arum</dc:creator>
      <dc:date>2012-01-04T19:26:54Z</dc:date>
    </item>
    <item>
      <title>using macro's, SQL, do loops to create SAS Variables for dates to run reports back 24 months</title>
      <link>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24205#M4053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks this is very helpful. I am new to SAS so tricks like %put _user_ are good. This works well. I will be using this trick and others parts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2012 22:33:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/using-macro-s-SQL-do-loops-to-create-SAS-Variables-for-dates-to/m-p/24205#M4053</guid>
      <dc:creator>Arum</dc:creator>
      <dc:date>2012-01-04T22:33:32Z</dc:date>
    </item>
  </channel>
</rss>

