<?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: Exact matching of two sets of book titles using SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570669#M12004</link>
    <description>&lt;P&gt;Though the error isn't there, but I'm not getting results. Can you share what your result look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2019 17:46:02 GMT</pubDate>
    <dc:creator>rwu7</dc:creator>
    <dc:date>2019-07-02T17:46:02Z</dc:date>
    <item>
      <title>Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570428#M11943</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find exact matches in two sets of book titles without regard to case-sensitive and abbreviations. Also I am new to SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Title 1:&lt;/P&gt;&lt;P&gt;AM J CLIN ONCOL CANC&lt;BR /&gt;ADV DRUG DELIVER REV&lt;BR /&gt;ADV ECOL RES&lt;BR /&gt;ABDOM RADIOL&lt;BR /&gt;ADV ELECTRON MATER&lt;BR /&gt;ENDOCR RELAT CANCER&lt;BR /&gt;MAYO CLIN PROC&lt;BR /&gt;MBIO&lt;BR /&gt;MCN AM J MATERN CHIL&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Title 2:&lt;BR /&gt;Abdom Radiol (NY)&lt;BR /&gt;ACS Appl Mater Interfaces&lt;BR /&gt;Adv Drug Deliv Rev&lt;BR /&gt;AJR Am J Roentgenol&lt;BR /&gt;Am J Clin Oncol&lt;BR /&gt;Endocr Relat Cancer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;***Expected Output something like this that shows exact title matches disregarding case-sensitve or abbreviations&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Exact matches&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ADV DRUG DELIVER REV : Adv Drug Deliv Rev&lt;BR /&gt;ABDOM RADIOL : Abdom Radiol (NY)&lt;BR /&gt;ENDOCR RELAT CANCER : Endocr Relat Cancer&lt;BR /&gt;AM J CLIN ONCOL CANC: Am J Clin Oncol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to write a code that does this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 05:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570428#M11943</guid>
      <dc:creator>rwu7</dc:creator>
      <dc:date>2019-07-02T05:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570460#M11957</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;This might help you start , this might not work in all cases for matching. Give it a try.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;data a;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;input title1 &amp;amp; $100.;&lt;/SPAN&gt;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PAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Adv Drug Deliv Rev&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AJR Am J Roentgenol&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Am J Clin Oncol&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Endocr Relat Cancer&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PROC SQL;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Create table dummy as&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;select title1, title2, catx(' ',title1,' : ',title2) as Exact_match&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;select a.*,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;substr(compress(lowcase(title1),' '),1,min_len) as temp_title1,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;substr(compress(lowcase(title2),' '),1,min_len) as temp_title2,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;spedis(calculated temp_title1, calculated temp_title2) as dis&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Select *,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;length(compress(title1,' ')) as len1,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;length(compress(title2,' ')) as len2,&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;case when calculated len1 &amp;lt; calculated len2 then calculated len1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;when calculated len2 &amp;lt; calculated len1 then calculated len2&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else calculated len1 end as min_len&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;from A1 as x cross join B1 as y&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) a&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;where calculated temp_title1 = calculated temp_title2 or calculated dis&amp;lt;=15&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Quit;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jul 2019 09:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570460#M11957</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2019-07-02T09:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570616#M11990</link>
      <description>&lt;P&gt;I tried running the code and got this error:&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: File WORK.A1.DATA does not exist.&lt;BR /&gt;ERROR: File WORK.B1.DATA does not exist.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;Did it work when you ran that code?&lt;/DIV&gt;</description>
      <pubDate>Tue, 02 Jul 2019 15:48:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570616#M11990</guid>
      <dc:creator>rwu7</dc:creator>
      <dc:date>2019-07-02T15:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570628#M11993</link>
      <description>try A &amp;amp; B , instead of A1 &amp;amp; B1</description>
      <pubDate>Tue, 02 Jul 2019 16:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570628#M11993</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2019-07-02T16:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570669#M12004</link>
      <description>&lt;P&gt;Though the error isn't there, but I'm not getting results. Can you share what your result look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 17:46:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570669#M12004</guid>
      <dc:creator>rwu7</dc:creator>
      <dc:date>2019-07-02T17:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570831#M12034</link>
      <description>&lt;P&gt;Snap shot of output.&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-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30720iEB2A86BC0E132CC8/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 05:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/570831#M12034</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2019-07-03T05:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571086#M12090</link>
      <description>&lt;P&gt;Can you post your code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not getting the same output as yours when I ran it. It only shows the title 1 data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the code I used:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data a;&lt;BR /&gt;input title1 &amp;amp; $100.;&lt;BR /&gt;datalines;&lt;BR /&gt;AM J CLIN ONCOL CANC&lt;BR /&gt;ADV DRUG DELIVER REV&lt;BR /&gt;ADV ECOL RES&lt;BR /&gt;ABDOM RADIOL&lt;BR /&gt;ADV ELECTRON MATER&lt;BR /&gt;ENDOCR RELAT CANCER&lt;BR /&gt;MAYO CLIN PROC&lt;BR /&gt;MBIO&lt;BR /&gt;MCN AM J MATERN CHIL&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt; &lt;BR /&gt;data b;&lt;BR /&gt;input title2 &amp;amp; $100.;&lt;BR /&gt;datalines;&lt;BR /&gt;Abdom Radiol (NY)&lt;BR /&gt;ACS Appl Mater Interfaces&lt;BR /&gt;Adv Drug Deliv Rev&lt;BR /&gt;AJR Am J Roentgenol&lt;BR /&gt;Am J Clin Oncol&lt;BR /&gt;Endocr Relat Cancer&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt; &lt;BR /&gt;PROC SQL;&lt;BR /&gt;Create table dummy as&lt;BR /&gt;select title1, title2, catx(' ',title1,' : ',title2) as Exact_match&lt;BR /&gt;from (&lt;BR /&gt;select a.*, &lt;BR /&gt;substr(compress(lowcase(title1),' '),1,min_len) as temp_title1,&lt;BR /&gt;substr(compress(lowcase(title2),' '),1,min_len) as temp_title2,&lt;BR /&gt;spedis(calculated temp_title1, calculated temp_title2) as dis&lt;BR /&gt;from (&lt;BR /&gt; &lt;BR /&gt;Select *, &lt;BR /&gt;length(compress(title1,' ')) as len1,&lt;BR /&gt;length(compress(title2,' ')) as len2, &lt;BR /&gt;case when calculated len1 &amp;lt; calculated len2 then calculated len1&lt;BR /&gt;when calculated len2 &amp;lt; calculated len1 then calculated len2 &lt;BR /&gt;else calculated len1 end as min_len &lt;BR /&gt;from A as x cross join B as y&lt;BR /&gt;) a&lt;BR /&gt;where calculated temp_title1 = calculated temp_title2 or calculated dis&amp;lt;=15&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;Quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2019 20:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571086#M12090</guid>
      <dc:creator>rwu7</dc:creator>
      <dc:date>2019-07-03T20:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571124#M12093</link>
      <description>&lt;P&gt;Its the same code as above, if you want only exact match variable , you can change sql query select statement&amp;nbsp; and keep only Exact_Match variable. And am not sure why your getting only title, any error or warning in logs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
PROC SQL;
Create table dummy as
select catx(' ',title1,' : ',title2) as Exact_match
from (
select a.*, 
substr(compress(lowcase(title1),' '),1,min_len) as temp_title1,
substr(compress(lowcase(title2),' '),1,min_len) as temp_title2,
spedis(calculated temp_title1, calculated temp_title2) as dis
from (
 
Select *, 
length(compress(title1,' ')) as len1,
length(compress(title2,' ')) as len2, 
case when calculated len1 &amp;lt; calculated len2 then calculated len1
when calculated len2 &amp;lt; calculated len1 then calculated len2 
else calculated len1 end as min_len 
from A as x cross join B as y
) a
where calculated temp_title1 = calculated temp_title2 or calculated dis&amp;lt;=15
)
;
Quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Jul 2019 04:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571124#M12093</guid>
      <dc:creator>RM6</dc:creator>
      <dc:date>2019-07-04T04:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: Exact matching of two sets of book titles using SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571449#M12172</link>
      <description>&lt;P&gt;I added this statement and it worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print noobs;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure why, but I'd be curious to know why.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again for your help!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2019 16:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Exact-matching-of-two-sets-of-book-titles-using-SAS/m-p/571449#M12172</guid>
      <dc:creator>rwu7</dc:creator>
      <dc:date>2019-07-05T16:54:06Z</dc:date>
    </item>
  </channel>
</rss>

