<?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: date and time constraints in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/628952#M185911</link>
    <description>&lt;P&gt;do you expect any instances of more than 2 overlapping time-spans.&amp;nbsp; Or is it always exactly 2?&amp;nbsp; In other words, how far ahead do you need to look to determine all the needed start/stop pairs?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 23:08:32 GMT</pubDate>
    <dc:creator>mkeintz</dc:creator>
    <dc:date>2020-03-02T23:08:32Z</dc:date>
    <item>
      <title>date and time constraints</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/628934#M185905</link>
      <description>&lt;P&gt;I have the following tables were subjects have overlapping date/time but i need to cut them by certain time to calculate different measures&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have table. For example row 1 has a longer duration but row 2 has short. I need to assign row 2 start time as new stop time for row 1and create a row 3 that has row 1 as new stop dt but with row 2 stop dt time as new start time for row 3. It can have more than 2 observations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="311px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="42.6667px" height="19px"&gt;patient&lt;/TD&gt;
&lt;TD width="62.6667px" height="19px"&gt;start_time&lt;/TD&gt;
&lt;TD width="61.3333px" height="19px"&gt;stop_time&lt;/TD&gt;
&lt;TD width="41.3333px" height="19px"&gt;value1&lt;/TD&gt;
&lt;TD width="41.3333px" height="19px"&gt;value2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.6667px" height="39px"&gt;1&lt;/TD&gt;
&lt;TD width="62.6667px" height="39px"&gt;12/1/2019 0:00&lt;/TD&gt;
&lt;TD width="61.3333px" height="39px"&gt;12/1/19 22:12&lt;/TD&gt;
&lt;TD width="41.3333px" height="39px"&gt;1&lt;/TD&gt;
&lt;TD width="41.3333px" height="39px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="42.6667px" height="39px"&gt;1&lt;/TD&gt;
&lt;TD width="62.6667px" height="39px"&gt;12/1/2019 10:12&lt;/TD&gt;
&lt;TD width="61.3333px" height="39px"&gt;12/1/19 10:42&lt;/TD&gt;
&lt;TD width="41.3333px" height="39px"&gt;0.5&lt;/TD&gt;
&lt;TD width="41.3333px" height="39px"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;TABLE width="355"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="49"&gt;patient&lt;/TD&gt;
&lt;TD width="107"&gt;start_time&lt;/TD&gt;
&lt;TD width="107"&gt;stop_time&lt;/TD&gt;
&lt;TD width="46"&gt;value1&lt;/TD&gt;
&lt;TD width="46"&gt;value2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;12/1/2019 0:00&lt;/TD&gt;
&lt;TD&gt;12/1/2019 10:12&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;12/1/2019 10:12&lt;/TD&gt;
&lt;TD&gt;12/1/19 10:42&lt;/TD&gt;
&lt;TD&gt;0.5&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;12/1/19 10:42&lt;/TD&gt;
&lt;TD&gt;12/1/19 22:12&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no idea how to start to be honest,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried _n = n + 1 for start_time &amp;lt; stop_date but i have no idea&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 00:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/628934#M185905</guid>
      <dc:creator>monday89</dc:creator>
      <dc:date>2020-03-03T00:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: date and time constraints</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/628952#M185911</link>
      <description>&lt;P&gt;do you expect any instances of more than 2 overlapping time-spans.&amp;nbsp; Or is it always exactly 2?&amp;nbsp; In other words, how far ahead do you need to look to determine all the needed start/stop pairs?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 23:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/628952#M185911</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-03-02T23:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: date and time constraints</title>
      <link>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/629152#M186019</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Thats a great question . it can be more than 2&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 15:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/date-and-time-constraints/m-p/629152#M186019</guid>
      <dc:creator>monday89</dc:creator>
      <dc:date>2020-03-03T15:47:54Z</dc:date>
    </item>
  </channel>
</rss>

