<?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 Collapsing Consecutive Dates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45711#M9458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at this thread from SAS-L last year.&amp;nbsp; Two approaches are discussed/provided for capturing date ranges:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1010E&amp;amp;L=sas-l&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=307534&amp;amp;P=4731"&gt;http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1010E&amp;amp;L=sas-l&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=307534&amp;amp;P=4731&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think that either approach could be modified to meet your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Aug 2011 13:29:18 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-08-10T13:29:18Z</dc:date>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45708#M9455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a new question regarding collapsing consecutive dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For my study I am looking at antibiotic prescriptions. I have already determined the patients who would have been given a single primary antibiotic. However, now I have to address those individuals who would fall into the mixed therapy category. For these individuals I want to collapse the start and stop dates for antibiotics given on consecutive dates. In addition to collapsing to a single date, I need to retain the antibiotic given on those dates (see example below).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 780px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl69" height="21" style="text-align: center;" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="64"&gt;RX_1&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="37"&gt;RX_2&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="61"&gt;Start_1&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="68"&gt;Start_2&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="64"&gt;Stop_1&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="68"&gt;Stop_2&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="85"&gt;New_Start&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="85"&gt;New_Stop&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="93"&gt;New_RX_1&lt;/TD&gt;&lt;TD class="xl65" style="text-align: center;" width="91"&gt;New_RX_2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="text-align: center;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="37"&gt;2&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="61"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="68"&gt;5/3/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="64"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="68"&gt;5/3/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="85"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="85"&gt;5/3/2001&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="93"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="91"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="21" style="text-align: center;" width="64"&gt;2&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="37"&gt;3&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="61"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="68"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="64"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="68"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="85"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="85"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="93"&gt;1&lt;/TD&gt;&lt;TD class="xl67" style="text-align: center;" width="91"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, not all individuals will have multiple treaments that can be collapsed into one set of consecutive dates. In those cases I need a data set that will look something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 1119px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="41" style="text-align: center;" width="64"&gt;ID&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="64"&gt;RX_1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="37"&gt;RX_2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="61"&gt;Start_1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="68"&gt;Start_2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="64"&gt;Stop_1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="68"&gt;Stop_2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="85"&gt;New_Start1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="85"&gt;New_Stop1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="93"&gt;New_Start2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="91"&gt;New_Stop2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="94"&gt;New_RX1_1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="81"&gt;New_RX1_2&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="85"&gt;New_RX2_1&lt;/TD&gt;&lt;TD class="xl66" style="text-align: center;" width="79"&gt;New_RX2_2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="21" style="text-align: center;" width="64"&gt;3&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="64"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="37"&gt;2&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="61"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="68"&gt;5/10/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="64"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="68"&gt;5/19/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="85"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="85"&gt;5/2/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="93"&gt;5/10/2001&lt;/TD&gt;&lt;TD class="xl69" style="text-align: center;" width="91"&gt;5/19/2001&lt;/TD&gt;&lt;TD class="xl70" style="text-align: center;" width="94"&gt;1&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="81"&gt;&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="85"&gt;2&lt;/TD&gt;&lt;TD class="xl68" style="text-align: center;" width="79"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The overall data set has up to 8 different prescription (RX), start, and stop dates that have to be collapsed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 21:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45708#M9455</guid>
      <dc:creator>jdukes42</dc:creator>
      <dc:date>2011-08-09T21:18:01Z</dc:date>
    </item>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45709#M9456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the dates in your example are from 2001.&amp;nbsp; What is the actual range of possible dates?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 21:42:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45709#M9456</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-09T21:42:05Z</dc:date>
    </item>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45710#M9457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dates range from 2005 to 2010. Thanks again for your interest and help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:03:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45710#M9457</guid>
      <dc:creator>jdukes42</dc:creator>
      <dc:date>2011-08-10T13:03:42Z</dc:date>
    </item>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45711#M9458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jonathan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at this thread from SAS-L last year.&amp;nbsp; Two approaches are discussed/provided for capturing date ranges:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1010E&amp;amp;L=sas-l&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=307534&amp;amp;P=4731"&gt;http://www.listserv.uga.edu/cgi-bin/wa?A2=ind1010E&amp;amp;L=sas-l&amp;amp;D=1&amp;amp;H=0&amp;amp;O=D&amp;amp;T=1&amp;amp;m=307534&amp;amp;P=4731&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think that either approach could be modified to meet your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45711#M9458</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-10T13:29:18Z</dc:date>
    </item>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45712#M9459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks. I will take a look at this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 13:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45712#M9459</guid>
      <dc:creator>jdukes42</dc:creator>
      <dc:date>2011-08-10T13:33:45Z</dc:date>
    </item>
    <item>
      <title>Collapsing Consecutive Dates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45713#M9460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not quit sure.&lt;/P&gt;&lt;P&gt;What does your dataset look like and what output do you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 05:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Collapsing-Consecutive-Dates/m-p/45713#M9460</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-08-11T05:12:16Z</dc:date>
    </item>
  </channel>
</rss>

