<?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 match find in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206648#M38408</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am working on some drug data set and need to specify patients using some drugs. The problem is we have some drug name but the data set contains not exactly same but similar name. The drug name in dataset may contain more word/letter than the name we have in hand. I just used exact match to identify patients using these drugs, so the result looks not correct. My code looks like the following. I just listed two names here, but actually I have many drug names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro drugs;&lt;/P&gt;&lt;P&gt;%do i = 1 %to 10;&lt;/P&gt;&lt;P&gt;data drug;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set drug;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drug_1=0;&lt;/P&gt;&lt;P&gt;drug_2=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if brandname in ('ADOXA', 'VECTRIN')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or genname in ('DOXYCYCLINE HYCLATE', 'QUINACRINE')&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then drug_1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if brandname in ('CIMZIA', 'SIMPONI ARIA')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or genname in ('ANAKINRA', 'GOLIMUMAB')&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then drug_2=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%drugs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Too few patients were identified by the above code. I am thinking to use proc sql and &lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;like &lt;/STRONG&gt;&lt;/SPAN&gt;'pattern' or &lt;SPAN style="color: #ff0000;"&gt;=*&lt;/SPAN&gt; operator, but not sure if it is a good way to do and also not sure if like or =* can be used with more than one drug names to do search. I am also concerning if sas can do macro and proc sql together. Could you help me write some sample code? Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Apr 2015 21:55:59 GMT</pubDate>
    <dc:creator>michellel</dc:creator>
    <dc:date>2015-04-29T21:55:59Z</dc:date>
    <item>
      <title>match find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206648#M38408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am working on some drug data set and need to specify patients using some drugs. The problem is we have some drug name but the data set contains not exactly same but similar name. The drug name in dataset may contain more word/letter than the name we have in hand. I just used exact match to identify patients using these drugs, so the result looks not correct. My code looks like the following. I just listed two names here, but actually I have many drug names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro drugs;&lt;/P&gt;&lt;P&gt;%do i = 1 %to 10;&lt;/P&gt;&lt;P&gt;data drug;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set drug;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;drug_1=0;&lt;/P&gt;&lt;P&gt;drug_2=0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if brandname in ('ADOXA', 'VECTRIN')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or genname in ('DOXYCYCLINE HYCLATE', 'QUINACRINE')&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then drug_1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if brandname in ('CIMZIA', 'SIMPONI ARIA')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or genname in ('ANAKINRA', 'GOLIMUMAB')&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then drug_2=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%drugs;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Too few patients were identified by the above code. I am thinking to use proc sql and &lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;like &lt;/STRONG&gt;&lt;/SPAN&gt;'pattern' or &lt;SPAN style="color: #ff0000;"&gt;=*&lt;/SPAN&gt; operator, but not sure if it is a good way to do and also not sure if like or =* can be used with more than one drug names to do search. I am also concerning if sas can do macro and proc sql together. Could you help me write some sample code? Thanks so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 21:55:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206648#M38408</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-04-29T21:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: match find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206649#M38409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you provide some examples of names which are not identical but which you want to be recognised as a match, please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 22:05:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206649#M38409</guid>
      <dc:creator>dkb</dc:creator>
      <dc:date>2015-04-29T22:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: match find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206650#M38410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have any issues with the case when matching? Currently you are searching for 'ADOXA'. Do you have values like 'Adoxa' in you your data? If so first step I would try would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If strip(upcase(brandname)) in ('ADOXA', 'VECTRIN') &lt;/P&gt;&lt;P&gt;or strip(upcase(genname)) in ('DOXYCYCLINE HYCLATE', 'QUINACRINE')&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then drug_1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strip is included in case any of your entered values have leading or trailing blanks. ' ADOXA' would not match 'ADOXA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extra words or letters may mean a more complicated search and you'll likely lose the IN operator and have to test for each of your values separately.&lt;/P&gt;&lt;P&gt;If index(upcase(brandname),'ADOXA') &amp;gt; 0 then drug1_1=1; /* then ADOXA is in the string somewhere*/&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;Find(brandname, 'ADOXA','it') &amp;gt; 0 then drug1_1=1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I strongly recommend getting something to work before looking at macros. Your existing shell macro processes the same data set 10 time exactly the same way. And using the:&lt;/P&gt;&lt;P&gt;data data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set data;&lt;/P&gt;&lt;P&gt;construct in a macro is just asking for a case where you have an error and can't determine where it happened.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2015 22:10:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206650#M38410</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-04-29T22:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: match find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206651#M38411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; like or =* can't be used to multiple matched. Why not try Hash Table or PRX .&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 15:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206651#M38411</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-04-30T15:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: match find</title>
      <link>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206652#M38412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much ballardw! It works!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 20:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/match-find/m-p/206652#M38412</guid>
      <dc:creator>michellel</dc:creator>
      <dc:date>2015-05-01T20:07:36Z</dc:date>
    </item>
  </channel>
</rss>

