<?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: Active clients based on admission and discharge dates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136649#M36854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An easy coding but possibly generates a large data set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data step1;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;do date=admission_date to discharge_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=step1;&lt;/P&gt;&lt;P&gt;table date/out=active_clients;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Oct 2014 02:33:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2014-10-22T02:33:03Z</dc:date>
    <item>
      <title>Active clients based on admission and discharge dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136648#M36853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a set of admission dates and discharge dates for the past 10 years that I want to turn into a graph of active cases for each date over the time period of interest.&lt;/P&gt;&lt;P&gt;Have:&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 233px;" summary="Page Layout"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl64" height="20" width="105"&gt;Admission_Date&lt;/TD&gt;&lt;TD class="xl65" style="border-left: none;" width="100"&gt;Discharge_Date&lt;/TD&gt;&lt;TD class="xl66" style="border-left: none;" width="28"&gt;id&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;22-Nov-11&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;26-Jul-13&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;17-Dec-12&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;01-May-14&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;30-Jan-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;07-Sep-13&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;05-Feb-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;08-Aug-13&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;18-Mar-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;16-Aug-13&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;10-May-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;04-Jun-14&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;23-May-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;20-Jan-14&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;12-Aug-13&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;31-Mar-14&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl67" height="20" style="border-top: none;" width="105"&gt;etc&lt;/TD&gt;&lt;TD align="right" class="xl63" style="border-top: none; border-left: none;" width="100"&gt;&lt;/TD&gt;&lt;TD align="right" class="xl68" style="border-top: none; border-left: none;" width="28"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so client 1 was active between Nov 22, 2011 to Jul 26, 2013...&lt;/P&gt;&lt;P&gt;want (example)&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 198px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl67" height="40" width="134"&gt;Date&lt;/TD&gt;&lt;TD class="xl67" width="64"&gt;Active Clients (count)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl66" height="20" width="134"&gt;22-Nov-11&lt;/TD&gt;&lt;TD align="right" class="xl68" width="64"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;23-Nov-11&lt;/TD&gt;&lt;TD align="right"&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;24-Nov-11&lt;/TD&gt;&lt;TD align="right"&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;25-Nov-11&lt;/TD&gt;&lt;TD align="right"&gt;18&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;26-Nov-11&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;27-Nov-11&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;etc.&lt;/TD&gt;&lt;TD align="right"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Which can be easily graphed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bruce&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 00:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136648#M36853</guid>
      <dc:creator>BigD</dc:creator>
      <dc:date>2014-10-22T00:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Active clients based on admission and discharge dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136649#M36854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;An easy coding but possibly generates a large data set:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data step1;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;do date=admission_date to discharge_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=step1;&lt;/P&gt;&lt;P&gt;table date/out=active_clients;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 02:33:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136649#M36854</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-10-22T02:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Active clients based on admission and discharge dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136650#M36855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you are concerned about generating too large a data set, then modify Reeza's code to use a view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data step1 / view=step1;&amp;nbsp; ** data step will be processed "in-line" when used without occupying excessive space **;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;do date=admission_date to discharge_date;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=step1;&lt;/P&gt;&lt;P&gt;table date/out=active_clients;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 02:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136650#M36855</guid>
      <dc:creator>DaveBirch</dc:creator>
      <dc:date>2014-10-22T02:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Active clients based on admission and discharge dates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136651#M36856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's pretty much it. I made the following modifications to get exactly what I needed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data step1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set have;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by id;&lt;/P&gt;&lt;P&gt;length_of_stay =discharge_date - admission_date;&lt;/P&gt;&lt;P&gt;by id;&lt;/P&gt;&lt;P&gt;do i= 1 to&amp;nbsp; length_of_stay by 1;;&lt;/P&gt;&lt;P&gt;count_date = ADMISSION_DATE + I;&lt;/P&gt;&lt;P&gt;OUTPUT;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;FORMAT count_date DATE9.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:54:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Active-clients-based-on-admission-and-discharge-dates/m-p/136651#M36856</guid>
      <dc:creator>BigD</dc:creator>
      <dc:date>2014-10-22T12:54:40Z</dc:date>
    </item>
  </channel>
</rss>

