<?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 Detect Recurrent Disease in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/451946#M114025</link>
    <description>&lt;P&gt;I am trying to write code to read recurrent diseases in a database.&amp;nbsp; I already successfully wrote code for comorbidity in the database.&amp;nbsp; However I cannot get the code that I have written below to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; kevinrecurrent; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; testtreat;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; recurrent $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;150&lt;/FONT&gt;&lt;/STRONG&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;recurrent = cat(lastname, firstname, dob_mo, dob_day, dob_yr, diagnosisdate);&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newrecurr=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.&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 face="Courier New" size="2" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrecurr ge &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;14&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; and newrecurr le &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;60&lt;/FONT&gt;&lt;/STRONG&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;I am attempting to create a variable (recurrent) which reads the firstname, lastname, date of birth and diagnosis date for the patient.&lt;/P&gt;
&lt;P&gt;I am also attempting to establish that recurrent cases are those between 2 weeks and 60 days after the first treatment&lt;/P&gt;
&lt;P&gt;how do I do this? I am stuck at above.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 15:25:15 GMT</pubDate>
    <dc:creator>kqmq</dc:creator>
    <dc:date>2018-04-06T15:25:15Z</dc:date>
    <item>
      <title>Detect Recurrent Disease</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/451946#M114025</link>
      <description>&lt;P&gt;I am trying to write code to read recurrent diseases in a database.&amp;nbsp; I already successfully wrote code for comorbidity in the database.&amp;nbsp; However I cannot get the code that I have written below to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; kevinrecurrent; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; testtreat;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; recurrent $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;150&lt;/FONT&gt;&lt;/STRONG&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;recurrent = cat(lastname, firstname, dob_mo, dob_day, dob_yr, diagnosisdate);&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newrecurr=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.&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 face="Courier New" size="2" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrecurr ge &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;14&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; and newrecurr le &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;60&lt;/FONT&gt;&lt;/STRONG&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;I am attempting to create a variable (recurrent) which reads the firstname, lastname, date of birth and diagnosis date for the patient.&lt;/P&gt;
&lt;P&gt;I am also attempting to establish that recurrent cases are those between 2 weeks and 60 days after the first treatment&lt;/P&gt;
&lt;P&gt;how do I do this? I am stuck at above.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/451946#M114025</guid>
      <dc:creator>kqmq</dc:creator>
      <dc:date>2018-04-06T15:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: writing code for sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/451952#M114030</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am attempting to create a variable (recurrent) which reads the firstname, lastname, date of birth and diagnosis date for the patient.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I don't know what that means. Can you please show an example, using fake data?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What are you expecting to happen with the CAT() function - which concatenates variables.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203259"&gt;@kqmq&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I am trying to write code to read recurrent diseases in a database.&amp;nbsp; I already successfully wrote code for comorbidity in the database.&amp;nbsp; However I cannot get the code that I have written below to work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#000080"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; kevinrecurrent; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; testtreat;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2" color="#0000ff"&gt;length&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; recurrent $&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;150&lt;/FONT&gt;&lt;/STRONG&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;recurrent = cat(lastname, firstname, dob_mo, dob_day, dob_yr, diagnosisdate);&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;newrecurr=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;.&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 face="Courier New" size="2" color="#0000ff"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrecurr ge &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;14&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt; and newrecurr le &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="2" color="#008080"&gt;60&lt;/FONT&gt;&lt;/STRONG&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;I am attempting to create a variable (recurrent) which reads the firstname, lastname, date of birth and diagnosis date for the patient.&lt;/P&gt;
&lt;P&gt;I am also attempting to establish that recurrent cases are those between 2 weeks and 60 days after the first treatment&lt;/P&gt;
&lt;P&gt;how do I do this? I am stuck at above.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 15:24:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/451952#M114030</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-06T15:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Detect Recurrent Disease</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/452023#M114042</link>
      <description>&lt;P&gt;This code is very suspect as to what you might be attempting.&lt;/P&gt;
&lt;PRE&gt;newrecurr=.;

if newrecurr ge 14 and newrecurr le 60;
&lt;/PRE&gt;
&lt;P&gt;The first line sets a missing value to a variable. Then you attempt to only keep records where the value is between 14 and 60.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The approach looks like you should sort your data by lastname, firstname, dob_mo, dob_day, dob_yr, and&amp;nbsp;diagnosisdate.&lt;/P&gt;
&lt;P&gt;Then you can use Retain and or first and last processing to see if a person has more than one diagnosis.&lt;/P&gt;
&lt;P&gt;I suspect you may be missing a detail or two such as which variable has the actual disease diagnosis (which should go before diagnosisdate in the sort order).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example of retaining a value from previous records and using it later for a comparison&lt;/P&gt;
&lt;PRE&gt;proc sort data=sashelp.class out=work.class;
  by sex age;
run;

data work.example;
   set work.class;
   by sex age;
   retain firstageweight firstageheight;
   if first.age then do;
      firstageweight=weight;
      firstageheight=height;
   end;
   diffageweight = weight - firstageweight;
   diffageheight = height - firstageheight;
run;&lt;/PRE&gt;
&lt;P&gt;Also is your diagnosisdate an actual SAS date valued numeric or something else? Date comparisons work much better with data values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You also might want to consider generating and actual DOB date value with :&lt;/P&gt;
&lt;P&gt;Dobdate = mdy(dob_mo, dob_day, dob_yr);&lt;/P&gt;
&lt;P&gt;format dobdate date9.;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 18:03:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-Recurrent-Disease/m-p/452023#M114042</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-04-06T18:03:57Z</dc:date>
    </item>
  </channel>
</rss>

