<?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: number of days in the study period in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274764#M54879</link>
    <description>&lt;P&gt;Here's one approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;class patientid;&lt;/P&gt;
&lt;P&gt;var encdate;&lt;/P&gt;
&lt;P&gt;output out=durations (keep=patientid firstday lastday) min=firstday max=lastday;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives you a data set with three variables in it, and one observation per patientid.&amp;nbsp; You can use that in a DATA step, and apply whichever formula you wish:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;duration = lastday - firstday;&lt;/P&gt;
&lt;P&gt;duration = lastday - firstday + 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SQL programmers out there can do this in one step, but SQL isn't my strong point.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2016 18:31:25 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2016-06-02T18:31:25Z</dc:date>
    <item>
      <title>number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274756#M54877</link>
      <description>&lt;P&gt;Hi! I need help calculating the number of actual days a person was in my 5 year study.&amp;nbsp; So, looking accross observations, I need to calculate number of days between the first encounter date 'encdate' and last encounter date by 'patientid'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assistance is apprecited!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:12:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274756#M54877</guid>
      <dc:creator>jenim514</dc:creator>
      <dc:date>2016-06-02T18:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274761#M54878</link>
      <description>&lt;P&gt;Please post sample input and output data.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:26:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274761#M54878</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-02T18:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274764#M54879</link>
      <description>&lt;P&gt;Here's one approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc summary data=have nway;&lt;/P&gt;
&lt;P&gt;class patientid;&lt;/P&gt;
&lt;P&gt;var encdate;&lt;/P&gt;
&lt;P&gt;output out=durations (keep=patientid firstday lastday) min=firstday max=lastday;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives you a data set with three variables in it, and one observation per patientid.&amp;nbsp; You can use that in a DATA step, and apply whichever formula you wish:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;duration = lastday - firstday;&lt;/P&gt;
&lt;P&gt;duration = lastday - firstday + 1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The SQL programmers out there can do this in one step, but SQL isn't my strong point.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 18:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274764#M54879</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-06-02T18:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274776#M54885</link>
      <description>&lt;P&gt;Minor change to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; solution:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;output out=durations (keep=patientid firstday lastday) range=;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Range will basically do the max-min.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 19:31:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274776#M54885</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-06-02T19:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274793#M54886</link>
      <description>&lt;P&gt;how can i get sas software&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274793#M54886</guid>
      <dc:creator>kvemulapalli571</dc:creator>
      <dc:date>2016-06-02T20:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274796#M54888</link>
      <description>please help me how can i get sas software&lt;BR /&gt;</description>
      <pubDate>Thu, 02 Jun 2016 20:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274796#M54888</guid>
      <dc:creator>kvemulapalli571</dc:creator>
      <dc:date>2016-06-02T20:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: number of days in the study period</title>
      <link>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274827#M54895</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88399"&gt;@kvemulapalli571﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;1. Please post your questions in a new discussion rather than in someone else's question&lt;/P&gt;
&lt;P&gt;2. Google "SAS University Edition" -&amp;gt; This is a free version of SAS available for learning purposes only. You need a 64bit machine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Or use SAS Academics on Demand -&amp;gt; Independent Learners option.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 22:38:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/number-of-days-in-the-study-period/m-p/274827#M54895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-02T22:38:41Z</dc:date>
    </item>
  </channel>
</rss>

