<?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: Transposing and Calculating in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552206#M9136</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Trying to calculate the mean number of days between cases of "Debridement" or "DI" (Debridement and Irrigation) by study number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Have:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Proc1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Procedure Date&lt;/P&gt;
&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09SEP13:15:34:00&lt;/P&gt;
&lt;P&gt;4 &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; DI &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; 11SEP13:13:20:00&lt;/P&gt;
&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12SEP13:14:45:00&lt;/P&gt;
&lt;P&gt;4 &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; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20SEP13:20:22:00&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DI &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; 23OCT14:23:22:00&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25OCT14:13:01:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Want:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Mean Days Between Cases of Debridement&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And how would you get 5.3 for the first? is that by computing the absolute difference of the the single DI datetime to all of the Debridement dates and then averaging?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do any of your studynum values have more than one DI datetime? If so describe how to calculate the individual differences that would be used for a mean?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 17:39:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-04-18T17:39:51Z</dc:date>
    <item>
      <title>Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552205#M9135</link>
      <description>&lt;P&gt;Trying to calculate the total number of days between cases of "Debridement" by study number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Have:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Proc1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Procedure Date&lt;/P&gt;&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09SEP13:15:34:00&lt;/P&gt;&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12SEP13:14:45:00&lt;/P&gt;&lt;P&gt;4 &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; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20SEP13:20:22:00&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25OCT14:13:01:00&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;26OCT14:15:01:00&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data Want:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Total Days Between Cases of Debridement&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.3&amp;nbsp;&lt;/P&gt;&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.1&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552205#M9135</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2019-04-18T17:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552206#M9136</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Trying to calculate the mean number of days between cases of "Debridement" or "DI" (Debridement and Irrigation) by study number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Have:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Proc1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Procedure Date&lt;/P&gt;
&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09SEP13:15:34:00&lt;/P&gt;
&lt;P&gt;4 &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; DI &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; 11SEP13:13:20:00&lt;/P&gt;
&lt;P&gt;4 &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;Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;12SEP13:14:45:00&lt;/P&gt;
&lt;P&gt;4 &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; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 20SEP13:20:22:00&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DI &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; 23OCT14:23:22:00&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debridement &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25OCT14:13:01:00&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data Want:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Studynum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Mean Days Between Cases of Debridement&lt;/P&gt;
&lt;P&gt;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5.3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And how would you get 5.3 for the first? is that by computing the absolute difference of the the single DI datetime to all of the Debridement dates and then averaging?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do any of your studynum values have more than one DI datetime? If so describe how to calculate the individual differences that would be used for a mean?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552206#M9136</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-18T17:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552208#M9137</link>
      <description>&lt;P&gt;Please explain the logic/math/algorithm used to determine 5.3 for studynum 4 and 2.1 for studynum 5 (neither of which are obvious to me, even in the simpler case of studynum 5)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552208#M9137</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-18T17:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552211#M9138</link>
      <description>I did not actually calculate that. I just put those numbers as an example. I'm trying to figure out how to calculate the total days between</description>
      <pubDate>Thu, 18 Apr 2019 17:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552211#M9138</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2019-04-18T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552212#M9139</link>
      <description>&lt;P&gt;DI and Debridement will be counted as the same thing. So yes. I just put 5.3 there is an example. I don't know the actual number&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552212#M9139</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2019-04-18T17:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552218#M9141</link>
      <description>&lt;P&gt;But we don't know how we would perform this calculation for studynum 4. You have to explain how it is done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For studynum 5, it would appear the answer is 1 day, 13 hours, 39 minutes, or the decimal equivalent. Is that correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 17:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552218#M9141</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-18T17:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552222#M9143</link>
      <description>&lt;P&gt;I would like to create SAS code that calculates the total days between cases of debridement by studynum. I don't know how to do that.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:02:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552222#M9143</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2019-04-18T18:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552225#M9146</link>
      <description>&lt;P&gt;And as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;and I have stated, we don't know what that means in the case of studynum 4. We can't tell you how to do this. We are asking for an explanation of what the calculations are, not the SAS code needed. Once we understand what the calculations are, we can determine the SAS code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need to talk to some subject matter expert at your company/university who can explain how to compute the average in the case of studynum 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would also like you to state that the answer I gave for studynum 5 is correct (or not).&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552225#M9146</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-04-18T18:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552226#M9147</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp; &amp;nbsp;Are you after this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Studynum            Proc1     : $20.                  Procedure_Date :datetime20.;
format      Procedure_Date datetime20.;
cards;
4                          Debridement            09SEP13:15:34:00
4                           DI                           11SEP13:13:20:00
4                          Debridement            12SEP13:14:45:00
4                           Debridement           20SEP13:20:22:00
5                         DI                               23OCT14:23:22:00
5                         Debridement              25OCT14:13:01:00
;

data want;
set have;
by Studynum;
k=datepart(Procedure_Date);
diffindays=dif(k);
if first.studynum then diffindays=0;
drop k;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:03:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552226#M9147</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-18T18:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552229#M9149</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I would like to create SAS code that calculates the total days between cases of debridement by studynum. I don't know how to do that.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Let's look at Study number 4. You have 3 numbers there so what is the total days?&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Is it from the first day to the last day,&lt;/LI&gt;
&lt;LI&gt;Or is the length between each treatment,&lt;/LI&gt;
&lt;LI&gt;Or is it length between each treatment averaged?&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;The technical issue here is trivial, but the logic of how it should be calculated is what we would need to know to properly answer this question.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:10:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552229#M9149</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-04-18T18:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552269#M9157</link>
      <description>&lt;P&gt;Similar approach to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;but maintaining the seconds for the calculation. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78398"&gt;@stancemcgraw&lt;/a&gt;&amp;nbsp;did not provide any rules about calculating anything. So I am getting the successive difference of seconds and averaging that. I leave the (should be trivial)&amp;nbsp;exercise of turning the number of seconds into "days".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Issues in defining the calculations that should be addressed:&lt;/P&gt;
&lt;P&gt;1) which values are to be compared. One "date" with the previous only or is some date compared with multiples?&lt;/P&gt;
&lt;P&gt;2) is the data sorted in ascending date within the studynum? If not how should negative differences be treated? Or should the data be sorted to prevent that.&lt;/P&gt;
&lt;P&gt;3) Are the differences supposed to be based on actual time difference or on "days" between values? If "days" between values describe how to calculate a partial day. The order of operations and approach on this step will make BIG differences in interpretation of results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
 input Studynum   Proc1 :$12.  ProcedureDate :datetime18.;
 format ProcedureDate datetime18.;
datalines;
4  Debridement  09SEP13:15:34:00
4  Debridement  12SEP13:14:45:00
4  Debridement  20SEP13:20:22:00
5  Debridement  25OCT14:13:01:00
5  Debridement  26OCT14:15:01:00
;
run;

data temp;
   set have;
   by studynum;
   ddt = dif(proceduredate);
   if first.studynum then ddt=.;
run;

Proc summary data=temp nway;
   class studynum;
   var ddt;
   output out=work.summary mean=;
run;
/* at this time the ddt is mean of successive datetime differences 
IN SECONDS
*/

proc print data=work.summary ;
   var studynum ddt;
   format ddt time12.;
run; &lt;/PRE&gt;
&lt;P&gt;The time format will show the mean number of hours, minutes and seconds in this case.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 18:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552269#M9157</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-18T18:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Transposing and Calculating</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552274#M9158</link>
      <description>&lt;P&gt;@ all respondents,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think OP is figuring out the requirement while we are pondering the same. Sure, our responses are gonna get the OP more confused while business experts themselves perhaps do not communicate well to the tech team. Lately, it seems the industry absolutely needs people to be familiar TECH+BUSINESS which apparently is hard to find.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, lunch break 2:00 CST&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 19:02:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Transposing-and-Calculating/m-p/552274#M9158</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-18T19:02:08Z</dc:date>
    </item>
  </channel>
</rss>

