<?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: How to decrease two min from date time field in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196518#M49137</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use intnx function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dates;&lt;/P&gt;&lt;P&gt;input ID$&amp;nbsp;&amp;nbsp; Datetime : anydtdte20.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_date=intnx('second',datetime,-120,'same');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;format datetime new_date datetime20.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/01/15 15:25:00&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Jun 2015 02:05:52 GMT</pubDate>
    <dc:creator>Jagadishkatam</dc:creator>
    <dc:date>2015-06-01T02:05:52Z</dc:date>
    <item>
      <title>How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196515#M49134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi I have a table that has a startdate/time I'm being ask to give it a 2 min buffer I need to reduce 2 min from it... Prefer as a data step if easier ....thanks&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;ID.&amp;nbsp;&amp;nbsp; Datetime&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/01/15 15:25:00&lt;/P&gt;&lt;P&gt;what I need&lt;/P&gt;&lt;P&gt;id.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datetime&lt;/P&gt;&lt;P&gt;A.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/01/15 15:23:00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2015 04:19:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196515#M49134</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-05-31T04:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196516#M49135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;120 seconds to substract&amp;nbsp; (see the basics of datetime).&amp;nbsp; If you prefer working on intervals you could use that also having the option of dropping time (eg non office hours).&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 31 May 2015 05:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196516#M49135</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-05-31T05:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196517#M49136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI &lt;/P&gt;&lt;P&gt;is it like this 05/30/15 18:25:00 -120 = 05/30/15 18:23:00 ? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 02:02:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196517#M49136</guid>
      <dc:creator>BETO</dc:creator>
      <dc:date>2015-06-01T02:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196518#M49137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also use intnx function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data dates;&lt;/P&gt;&lt;P&gt;input ID$&amp;nbsp;&amp;nbsp; Datetime : anydtdte20.;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_date=intnx('second',datetime,-120,'same');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;format datetime new_date datetime20.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/01/15 15:25:00&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 02:05:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196518#M49137</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2015-06-01T02:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196519#M49138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No need to bother with datetime internal representation, substract a time constant (thanks Jag)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data dates;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input ID$&amp;nbsp;&amp;nbsp; Datetime &amp;amp; :anydtdtm20.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;new_date = datetime -&lt;SPAN style="color: #800000;"&gt; '00:02:00't&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;format datetime new_date datetime20.;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05/01/15 15:25:00&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc print; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 02:27:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196519#M49138</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-06-01T02:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196520#M49139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct PGstats, your example is showing the usage of knowing the internal representation in a way not being aware it anymore.&lt;BR /&gt;It is having:&lt;/P&gt;&lt;P&gt; - a datetime variable being input from a string. That internal representation is a counter based on seconds. (1jan1960)&lt;/P&gt;&lt;P&gt; - substracting those 120 seconds as a converted string being defined as string-time constant&lt;/P&gt;&lt;P&gt;This will be a new valid datetime variabele wit a value as OP's wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Not being aware why something is working is making it difficult to explain to the newbies.&lt;BR /&gt;This is having a good background not everything is having a background and can be explained or is having a reason. &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 05:44:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196520#M49139</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-06-01T05:44:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to decrease two min from date time field</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196521#M49140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The secret behind it all is that SAS stores dates as simple numbers, counting the days from 01/01/1960. Similarly, datetimes (and times) are stored as numbers counting seconds.&lt;/P&gt;&lt;P&gt;Therefore, '00:02:00't and 120 are the same constant.&lt;/P&gt;&lt;P&gt;What is needed is to correctly input date/datetime/time values into a SAS dataset, using the proper informat.&lt;/P&gt;&lt;P&gt;As shown by &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jun 2015 08:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-decrease-two-min-from-date-time-field/m-p/196521#M49140</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-06-01T08:37:33Z</dc:date>
    </item>
  </channel>
</rss>

