<?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: Adding days to a DATETIME value? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88034#M873</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd use one of SAS's most powerful date/datetime functions: INTNX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somewhat like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let filterdate_end = %sysfunc( intnx( dtday, "&amp;amp;filterdate_start"dt, 2 ) , datetime20. ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two assumptions here: &amp;amp;filterdate_start is the formatted datetime value, &amp;amp;filterdate_end is expected to be in datetime20. format.&lt;/P&gt;&lt;P&gt;If not then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let filterdate_end = %sysfunc( intnx( dtday, &amp;amp;filterdate_start, 2 ) ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will do and return the result as the number of seconds since SAS epoch (formatting then left to you).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Dec 2012 12:18:42 GMT</pubDate>
    <dc:creator>Robert_Bardos</dc:creator>
    <dc:date>2012-12-03T12:18:42Z</dc:date>
    <item>
      <title>Adding days to a DATETIME value?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88032#M871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a macrovariable called &amp;amp;filterdate_start. It's DATETIME20 and has the value 26NOV2012:00:00:00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a new macrovariable called &amp;amp;filterdate_end to equal &amp;amp;filterdate_start + 2 days, with the value 28NOV2012:00:00:00.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the most practical way to add 2 days to a DATETIME20 value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 11:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88032#M871</guid>
      <dc:creator>TurnTheBacon</dc:creator>
      <dc:date>2012-12-03T11:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Adding days to a DATETIME value?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88033#M872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want the same time of day, just add 2 * 24 * 60 * 60.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 11:55:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88033#M872</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2012-12-03T11:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: Adding days to a DATETIME value?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88034#M873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd use one of SAS's most powerful date/datetime functions: INTNX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somewhat like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let filterdate_end = %sysfunc( intnx( dtday, "&amp;amp;filterdate_start"dt, 2 ) , datetime20. ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two assumptions here: &amp;amp;filterdate_start is the formatted datetime value, &amp;amp;filterdate_end is expected to be in datetime20. format.&lt;/P&gt;&lt;P&gt;If not then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let filterdate_end = %sysfunc( intnx( dtday, &amp;amp;filterdate_start, 2 ) ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will do and return the result as the number of seconds since SAS epoch (formatting then left to you).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 12:18:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Adding-days-to-a-DATETIME-value/m-p/88034#M873</guid>
      <dc:creator>Robert_Bardos</dc:creator>
      <dc:date>2012-12-03T12:18:42Z</dc:date>
    </item>
  </channel>
</rss>

