<?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 Adding Months to a Date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366033#M275170</link>
    <description>&lt;P&gt;This is probably an easy answer, but how does one add months to a date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suppose date_start='01Aug2015'd and I use this as the ending point for my historical data. When I build my model and use the lead=12 option for my arima forecast, I'd like to be able to use that 12 in the lead statement to autiomatically calculate a bound for using the band command to shade in the forecast area in sgplot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to be able to take that 12 and add it to date_start. I don't seem to be able to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date_end=date_start + 12,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I add twelve months to date_start? I actually have a variable called lead_var that passes the lead value so I can change it in one place as a global variable and it will affect all arima calls. So in effect I need to be able to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;date_end=date_start + lead_var&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with lead_var=12 in this case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for all your help. These forums are amazing!&lt;/P&gt;&lt;P&gt;-Bill&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 02:19:42 GMT</pubDate>
    <dc:creator>BCNAV</dc:creator>
    <dc:date>2017-06-12T02:19:42Z</dc:date>
    <item>
      <title>Adding Months to a Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366033#M275170</link>
      <description>&lt;P&gt;This is probably an easy answer, but how does one add months to a date variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suppose date_start='01Aug2015'd and I use this as the ending point for my historical data. When I build my model and use the lead=12 option for my arima forecast, I'd like to be able to use that 12 in the lead statement to autiomatically calculate a bound for using the band command to shade in the forecast area in sgplot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I need to be able to take that 12 and add it to date_start. I don't seem to be able to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date_end=date_start + 12,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So how can I add twelve months to date_start? I actually have a variable called lead_var that passes the lead value so I can change it in one place as a global variable and it will affect all arima calls. So in effect I need to be able to use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;date_end=date_start + lead_var&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;with lead_var=12 in this case.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for all your help. These forums are amazing!&lt;/P&gt;&lt;P&gt;-Bill&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 02:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366033#M275170</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2017-06-12T02:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Months to a Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366034#M275171</link>
      <description>&lt;PRE&gt;data have;
  input date date9.;
  format date date9.;
  cards;
2feb2017
3apr2016
;
data want;
  set have;
  format newdate date9.;
  newdate=intnx('month',date,12,'s');
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 02:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366034#M275171</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-12T02:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Months to a Date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366167#M275172</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked perfectly&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Adding-Months-to-a-Date/m-p/366167#M275172</guid>
      <dc:creator>BCNAV</dc:creator>
      <dc:date>2017-06-12T14:35:12Z</dc:date>
    </item>
  </channel>
</rss>

