<?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 Indicating treatment within the previous two years in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562566#M17245</link>
    <description>&lt;P&gt;Dear experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two datasets - one with admission and a second one with treatments. I would like to know whether a specific patient have been treated with in the last two years. A patient can have multiple treatments and admissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datasets look like have1 and have 2 (see below). Want is what&amp;nbsp;I would like to see with an indicator variable showing whether this specific patient at this specific admission have been treated within the last two years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards Solvej&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;admission_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(Admission_date Discharge_date ) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date Discharge_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;1 2 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;1 3 03-03-2011 31-03-2011&lt;/P&gt;&lt;P&gt;2 1 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;2 2 01-01-2011 01-02-2011&lt;/P&gt;&lt;P&gt;2 3 03-03-2013 31-03-2013&lt;/P&gt;&lt;P&gt;2 4 03-03-2018 31-03-2018&lt;/P&gt;&lt;P&gt;3 2 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;3 2 03-03-2015 31-03-2015&lt;/P&gt;&lt;P&gt;4 2 04-02-2011 04-03-2011&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;treat_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(treatin_date treatout_date) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; treatin_date treatout_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2007 01-02-2007&lt;/P&gt;&lt;P&gt;1 2 03-02-2010 28-02-2010&lt;/P&gt;&lt;P&gt;1 3 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;2 1 01-01-2006 01-02-2006&lt;/P&gt;&lt;P&gt;2 2 01-01-2008 01-03-2008&lt;/P&gt;&lt;P&gt;2 3 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;3 1 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;4 1 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;4 2 04-02-2012 04-03-2012&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;admission_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(Admission_date Discharge_date ) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;treated_2years_prior;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date Discharge_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2010 01-02-2010 0&lt;/P&gt;&lt;P&gt;1 2 03-03-2010 31-03-2010 1&lt;/P&gt;&lt;P&gt;1 3 03-03-2011 31-03-2011 1&lt;/P&gt;&lt;P&gt;2 1 01-01-2010 01-02-2010 1&lt;/P&gt;&lt;P&gt;2 2 01-01-2011 01-02-2011 0&lt;/P&gt;&lt;P&gt;2 3 03-03-2013 31-03-2013 0&lt;/P&gt;&lt;P&gt;2 4 03-03-2018 31-03-2018 1&lt;/P&gt;&lt;P&gt;3 2 03-03-2010 31-03-2010 0&lt;/P&gt;&lt;P&gt;3 2 03-03-2015 31-03-2015 0&lt;/P&gt;&lt;P&gt;4 2 04-02-2011 04-03-2011 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2019 14:58:25 GMT</pubDate>
    <dc:creator>Solvej</dc:creator>
    <dc:date>2019-05-30T14:58:25Z</dc:date>
    <item>
      <title>Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562566#M17245</link>
      <description>&lt;P&gt;Dear experts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two datasets - one with admission and a second one with treatments. I would like to know whether a specific patient have been treated with in the last two years. A patient can have multiple treatments and admissions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datasets look like have1 and have 2 (see below). Want is what&amp;nbsp;I would like to see with an indicator variable showing whether this specific patient at this specific admission have been treated within the last two years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it makes sense.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards Solvej&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;admission_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(Admission_date Discharge_date ) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date Discharge_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;1 2 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;1 3 03-03-2011 31-03-2011&lt;/P&gt;&lt;P&gt;2 1 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;2 2 01-01-2011 01-02-2011&lt;/P&gt;&lt;P&gt;2 3 03-03-2013 31-03-2013&lt;/P&gt;&lt;P&gt;2 4 03-03-2018 31-03-2018&lt;/P&gt;&lt;P&gt;3 2 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;3 2 03-03-2015 31-03-2015&lt;/P&gt;&lt;P&gt;4 2 04-02-2011 04-03-2011&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;treat_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(treatin_date treatout_date) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; treatin_date treatout_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2007 01-02-2007&lt;/P&gt;&lt;P&gt;1 2 03-02-2010 28-02-2010&lt;/P&gt;&lt;P&gt;1 3 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;2 1 01-01-2006 01-02-2006&lt;/P&gt;&lt;P&gt;2 2 01-01-2008 01-03-2008&lt;/P&gt;&lt;P&gt;2 3 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;3 1 03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;4 1 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;4 2 04-02-2012 04-03-2012&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;admission_number&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(Admission_date Discharge_date ) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;treated_2years_prior;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date Discharge_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 1 01-01-2010 01-02-2010 0&lt;/P&gt;&lt;P&gt;1 2 03-03-2010 31-03-2010 1&lt;/P&gt;&lt;P&gt;1 3 03-03-2011 31-03-2011 1&lt;/P&gt;&lt;P&gt;2 1 01-01-2010 01-02-2010 1&lt;/P&gt;&lt;P&gt;2 2 01-01-2011 01-02-2011 0&lt;/P&gt;&lt;P&gt;2 3 03-03-2013 31-03-2013 0&lt;/P&gt;&lt;P&gt;2 4 03-03-2018 31-03-2018 1&lt;/P&gt;&lt;P&gt;3 2 03-03-2010 31-03-2010 0&lt;/P&gt;&lt;P&gt;3 2 03-03-2015 31-03-2015 0&lt;/P&gt;&lt;P&gt;4 2 04-02-2011 04-03-2011 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 14:58:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562566#M17245</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-30T14:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562578#M17247</link>
      <description>&lt;P&gt;You have two dates for each data set. Which dates are to be compared?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 14:27:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562578#M17247</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-30T14:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562579#M17248</link>
      <description>&lt;P&gt;Have 1 includes the admission and have 2 the treatments. Have 2 treat_out date&amp;nbsp;have to be maximum&amp;nbsp;two years&amp;nbsp;prior&amp;nbsp;to admission in order for the indicator variable to be 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 14:41:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562579#M17248</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-30T14:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562587#M17249</link>
      <description>&lt;P&gt;Ok. And about your&amp;nbsp;admission_number and&amp;nbsp;treat_number.. Are these to be compared? I mean, are record_id=1,&amp;nbsp;admission_number=1 in have1 to be compared to&amp;nbsp;record_id=1, treat_number=1 in have2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put another way: What date should&amp;nbsp;&lt;STRONG&gt;01-01-2010&amp;nbsp;&lt;/STRONG&gt;in observation 1 in have1 be compared to in have2?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 15:15:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562587#M17249</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-30T15:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562604#M17251</link>
      <description>&lt;P&gt;Patient number 1 in have1&amp;nbsp;have to be compared to all treatments in have2 for patient number 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 15:57:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562604#M17251</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-30T15:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562622#M17252</link>
      <description>I.e.&lt;BR /&gt;1 1 01-01-2010 01-02-2010&lt;BR /&gt;&lt;BR /&gt;have to be compared to all these linies&lt;BR /&gt;&lt;BR /&gt;1 1 01-01-2007 01-02-2007&lt;BR /&gt;&lt;BR /&gt;1 2 03-02-2010 28-02-2010&lt;BR /&gt;&lt;BR /&gt;1 3 03-03-2017 31-03-2017&lt;BR /&gt;&lt;BR /&gt;However non of them are within the to years time span prior to 01-01-2010, hence the indicator variable should be 0&lt;BR /&gt;</description>
      <pubDate>Thu, 30 May 2019 16:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562622#M17252</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-30T16:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562625#M17253</link>
      <description>So you want &amp;lt;= 2 years to have passed between the earliest treatment date and the latest discharge date?  Or between the latest treatment date and the earliest admit date?&lt;BR /&gt;Also, "year" is not a well-defined term.  Depending on how you define it, two years could be anywhere between 366 days and 1,095 days (look at the different definitions of year in the documentation for the YRDIF function, and that doesn't cover all the possibilities).  Because SAS dates are measured in days, it would be better to say something like "within 730 days".&lt;BR /&gt;&lt;BR /&gt;24    %put DAYS=%sysevalf(%sysfunc(yrdif('01jan2000'd, '31dec2002'd)), integer);&lt;BR /&gt;DAYS=2&lt;BR /&gt;25&lt;BR /&gt;26    %put DAYS=%sysevalf('31dec2002'd - '01jan2000'd);&lt;BR /&gt;DAYS=1095&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 May 2019 16:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562625#M17253</guid>
      <dc:creator>JackHamilton</dc:creator>
      <dc:date>2019-05-30T16:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Indication treatment within the last two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562629#M17254</link>
      <description>I want to know if there is less than two years (2*365.25 days) between any of the treatment intervals that have startet prior to each of the admissions.</description>
      <pubDate>Thu, 30 May 2019 17:00:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562629#M17254</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-30T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562684#M17258</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/108044"&gt;@Solvej&lt;/a&gt;&amp;nbsp;, I believe this gives you what you want?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table temp as
   select have1.*,
          have2.treatout_date
   from have1, have2
   where have1.Record_id=have2.Record_id;
quit;

data want(drop=treatout_date);
   treated_2years_prior=0;
   do until (last.admission_number | last.Admission_date);
      set temp;
      by admission_number notsorted Admission_date notsorted;
      if intnx('year', Admission_date, -2, 's') le treatout_date le Admission_date then treated_2years_prior=1;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which gives&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/29910iF95378F376B6DB56/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2019 19:28:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562684#M17258</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-30T19:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562993#M17267</link>
      <description>Thank you the solution works, however I loss all the patients that have not been treated at all thus are not included in have2.&lt;BR /&gt;&lt;BR /&gt;Can these be kept in some way?</description>
      <pubDate>Fri, 31 May 2019 19:51:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/562993#M17267</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-31T19:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563004#M17268</link>
      <description>&lt;P&gt;So if &lt;STRONG&gt;have1&amp;nbsp;&lt;/STRONG&gt;looks like below.. Should the last record be in the desired result as well?&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 20:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563004#M17268</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-31T20:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563011#M17269</link>
      <description>&lt;P&gt;If I am correct, then this is a quick fix for the code I provided already&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create table temp2 as
   select *, 0 as treated_2years_prior from have1 where Record_id not in 
   (select distinct Record_id from have2);
quit;

proc append base=want data=temp2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 20:37:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563011#M17269</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-05-31T20:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Indicating treatment within the previous two years</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563034#M17270</link>
      <description>&lt;P&gt;How come the result change if&amp;nbsp;I sort the admission&amp;nbsp;data prior to the procedures?&amp;nbsp;How can&amp;nbsp;I get the right result everytime not&amp;nbsp;depending on how the data is sorted?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added a sorting statement to the below procedure. And notice that I have removed the admission number because I dont have that after all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(Admission_date Discharge_date ) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date Discharge_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;1 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;1 03-03-2011 31-03-2011&lt;/P&gt;&lt;P&gt;2 01-01-2010 01-02-2010&lt;/P&gt;&lt;P&gt;2 01-01-2011 01-02-2011&lt;/P&gt;&lt;P&gt;2 03-03-2013 31-03-2013&lt;/P&gt;&lt;P&gt;2 03-03-2018 31-03-2018&lt;/P&gt;&lt;P&gt;3 03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;3 03-03-2015 31-03-2015&lt;/P&gt;&lt;P&gt;4 04-02-2011 04-03-2011&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;input&lt;/P&gt;&lt;P&gt;Record_id&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;(treatin_date treatout_date) (:&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyy10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; treatin_date treatout_date &lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;ddmmyyd10.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;datalines&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;01-01-2007 01-02-2007&lt;/P&gt;&lt;P&gt;1&amp;nbsp;03-02-2010 28-02-2010&lt;/P&gt;&lt;P&gt;1&amp;nbsp;03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;2&amp;nbsp;01-01-2006 01-02-2006&lt;/P&gt;&lt;P&gt;2&amp;nbsp;01-01-2008 01-03-2008&lt;/P&gt;&lt;P&gt;2&amp;nbsp;03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;3&amp;nbsp;03-03-2017 31-03-2017&lt;/P&gt;&lt;P&gt;4&amp;nbsp;03-03-2010 31-03-2010&lt;/P&gt;&lt;P&gt;4&amp;nbsp;04-02-2012 04-03-2012&lt;/P&gt;&lt;P&gt;5&amp;nbsp;07-02-2012 02-04-2012&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;/*proc sort data=have1; by record_id admission_date; run;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="2"&gt;have1.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;*,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;have2.treatout_date&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have1, have2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have1.Record_id=have2.Record_id;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;drop&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=treatout_date);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;treated_2years_prior=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;0&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;do&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;until&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; (last.record_id| last.Admission_date);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;by&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; record_id &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;notsorted&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; Admission_date &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;notsorted&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; intnx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'year'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, Admission_date, -&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'s'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) le treatout_date le Admission_date &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; treated_2years_prior=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 22:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Indicating-treatment-within-the-previous-two-years/m-p/563034#M17270</guid>
      <dc:creator>Solvej</dc:creator>
      <dc:date>2019-05-31T22:26:47Z</dc:date>
    </item>
  </channel>
</rss>

