<?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: SAS EG: Create a timeseries in a data step with intnx in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-Create-a-timeseries-in-a-data-step-with-intnx/m-p/635004#M188509</link>
    <description>&lt;P&gt;First of all, macro variables are not resolved when enclosed in single quotes. Second, you already have quotes in your macro variables, so that won't work either. Third, without a date format your results will not display right.&lt;/P&gt;
&lt;P&gt;So do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let startdate = 01jan2020;

data test;
format Reporting_Date yymmddd10.;
 do t = 1 to 48;
  Reporting_Date = intnx('month', "&amp;amp;startdate."d, t-1, 'E');
  output;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 26 Mar 2020 11:18:53 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-03-26T11:18:53Z</dc:date>
    <item>
      <title>SAS EG: Create a timeseries in a data step with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-Create-a-timeseries-in-a-data-step-with-intnx/m-p/635002#M188507</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you have a quick solution for this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a timeseries for 48 months. Always get month end by providing a start date via a macro variable. My code below doesn't work. Any ideas?&lt;/P&gt;&lt;P&gt;So, Reporting_Date should look like:&lt;/P&gt;&lt;P&gt;31jan2020&lt;/P&gt;&lt;P&gt;29feb2020&lt;/P&gt;&lt;P&gt;31mar2020&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let startdate = '01jan2020'd;

data test;
 do t = 1 to 48;
  Reporting_Date = intnx('month', '&amp;amp;startdate.', t-1, 'E');
  output;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 11:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-EG-Create-a-timeseries-in-a-data-step-with-intnx/m-p/635002#M188507</guid>
      <dc:creator>AndreasF</dc:creator>
      <dc:date>2020-03-26T11:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS EG: Create a timeseries in a data step with intnx</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-EG-Create-a-timeseries-in-a-data-step-with-intnx/m-p/635004#M188509</link>
      <description>&lt;P&gt;First of all, macro variables are not resolved when enclosed in single quotes. Second, you already have quotes in your macro variables, so that won't work either. Third, without a date format your results will not display right.&lt;/P&gt;
&lt;P&gt;So do this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let startdate = 01jan2020;

data test;
format Reporting_Date yymmddd10.;
 do t = 1 to 48;
  Reporting_Date = intnx('month', "&amp;amp;startdate."d, t-1, 'E');
  output;
 end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 11:18:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-EG-Create-a-timeseries-in-a-data-step-with-intnx/m-p/635004#M188509</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-03-26T11:18:53Z</dc:date>
    </item>
  </channel>
</rss>

