<?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 arrays -computing time values against each other in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459865#M116842</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello all;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have is a set of&amp;nbsp; timestamps and a Patient ID number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PAT_ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COL1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COL2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COL3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COL4&lt;/P&gt;
&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01JAN17:12:00:00&amp;nbsp; &amp;nbsp;01JAN17:13:00:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;01JAN17:13:30:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01JAN17:15:00:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need to do is compute the time differences between col1 &amp;amp; col2, col1&amp;amp;co3 ,col1&amp;amp;co4&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then col2&amp;amp;col3, col2&amp;amp;col4&lt;/P&gt;
&lt;P&gt;and then finally col3&amp;amp;col4 and then get the first timestamp&amp;nbsp; with the&amp;nbsp; time difference under 120 minutes.&lt;/P&gt;
&lt;P&gt;so in the example above it would output col1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The time stamps above are when a patient when into hypotension-however there has to be at least two episodes within 120 minutes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not even sure how to begin the array on this one-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance on where to begin much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 03 May 2018 21:41:22 GMT</pubDate>
    <dc:creator>LB</dc:creator>
    <dc:date>2018-05-03T21:41:22Z</dc:date>
    <item>
      <title>arrays -computing time values against each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459865#M116842</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello all;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I have is a set of&amp;nbsp; timestamps and a Patient ID number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Such as&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PAT_ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COL1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COL2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;COL3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; COL4&lt;/P&gt;
&lt;P&gt;123&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01JAN17:12:00:00&amp;nbsp; &amp;nbsp;01JAN17:13:00:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;01JAN17:13:30:00&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;01JAN17:15:00:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I need to do is compute the time differences between col1 &amp;amp; col2, col1&amp;amp;co3 ,col1&amp;amp;co4&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then col2&amp;amp;col3, col2&amp;amp;col4&lt;/P&gt;
&lt;P&gt;and then finally col3&amp;amp;col4 and then get the first timestamp&amp;nbsp; with the&amp;nbsp; time difference under 120 minutes.&lt;/P&gt;
&lt;P&gt;so in the example above it would output col1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The time stamps above are when a patient when into hypotension-however there has to be at least two episodes within 120 minutes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not even sure how to begin the array on this one-&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any assistance on where to begin much appreciated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lawrence&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 21:41:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459865#M116842</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2018-05-03T21:41:22Z</dc:date>
    </item>
    <item>
      <title>Re: arrays -computing time values against each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459870#M116843</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input PAT_ID         (COL1                      COL2                                   COL3                          COL4) (:datetime20.);
format COL1                      COL2                                   COL3                          COL4 datetime20.;
cards;
123             01JAN17:12:00:00   01JAN17:13:00:00              01JAN17:13:30:00       01JAN17:15:00:00
;

data want;
set have;
array col(*) col:;
do i=1 to dim(col)-1;
do j=i+1 to dim(col);
minutes=intck('minute',col(i),col(j));
/*@Lawrence, I am lazy- so Can you write your IF condition here however you want to filter, or let us know if you need detailed help*/
output;/* comment output when you have tested*/ 
end;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 May 2018 22:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459870#M116843</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-03T22:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: arrays -computing time values against each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459872#M116844</link>
      <description>&lt;P&gt;Many thanks&lt;SPAN class="login-bold"&gt;&amp;nbsp;Novinosrin!&amp;nbsp; Worked like a charm!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;Lawrence&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 22:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459872#M116844</guid>
      <dc:creator>LB</dc:creator>
      <dc:date>2018-05-03T22:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: arrays -computing time values against each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459873#M116845</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10675"&gt;@LB&lt;/a&gt;&amp;nbsp;You are welcome. Feel free to have any follow up questions should you have. I will respond if i am not too tired &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 22:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/arrays-computing-time-values-against-each-other/m-p/459873#M116845</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-05-03T22:10:02Z</dc:date>
    </item>
  </channel>
</rss>

