<?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 Compare two variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66696#M14474</link>
    <description>There are two tables.Price dataset and Product dataset.&lt;BR /&gt;
Recently I came across an issue where the product name in the price list has minor variation from the same product name in product dataset.This is causing drop in sales.&lt;BR /&gt;
&lt;BR /&gt;
for instance:&lt;BR /&gt;
price dataset has product name as CANDOR LEVODOPA 10MG.&lt;BR /&gt;
product dataset has  product name as CANDOR LEVODOPA  10MG.&lt;BR /&gt;
&lt;BR /&gt;
not only that misspelling  CANDOR LEVIDOPA  10MG.&lt;BR /&gt;
&lt;BR /&gt;
How to compare character by character and identify where there is difference?</description>
    <pubDate>Tue, 17 May 2011 23:49:25 GMT</pubDate>
    <dc:creator>SASPhile</dc:creator>
    <dc:date>2011-05-17T23:49:25Z</dc:date>
    <item>
      <title>Compare two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66696#M14474</link>
      <description>There are two tables.Price dataset and Product dataset.&lt;BR /&gt;
Recently I came across an issue where the product name in the price list has minor variation from the same product name in product dataset.This is causing drop in sales.&lt;BR /&gt;
&lt;BR /&gt;
for instance:&lt;BR /&gt;
price dataset has product name as CANDOR LEVODOPA 10MG.&lt;BR /&gt;
product dataset has  product name as CANDOR LEVODOPA  10MG.&lt;BR /&gt;
&lt;BR /&gt;
not only that misspelling  CANDOR LEVIDOPA  10MG.&lt;BR /&gt;
&lt;BR /&gt;
How to compare character by character and identify where there is difference?</description>
      <pubDate>Tue, 17 May 2011 23:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66696#M14474</guid>
      <dc:creator>SASPhile</dc:creator>
      <dc:date>2011-05-17T23:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66697#M14475</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
You have to do some data cleansing manually.&lt;BR /&gt;
However, I would suggest you to try sounds-like operator to compare product_name variables in two tables. Refer to:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473716.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473716.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I have tried a sample code to test this.&lt;BR /&gt;
/* -------------------------------------------------------------------------------- */&lt;BR /&gt;
data price;&lt;BR /&gt;
product_name='CANDOR LEVODOPA 10MG';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data product;&lt;BR /&gt;
product_name='CANDOR LEVIDOPA 10MG';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
/* The following sql won't return any row when using 'equal to i.e. =' operator in where clause */&lt;BR /&gt;
create table compare_price_product_eq as&lt;BR /&gt;
select pri.product_name as pri_product_name, pro.product_name as pro_product_name&lt;BR /&gt;
from price pri, product pro&lt;BR /&gt;
where pri.product_name = pro.product_name;&lt;BR /&gt;
&lt;BR /&gt;
/* The following sql will return a row when using 'sound like i.e. =*' operator in where clause */&lt;BR /&gt;
create table compare_price_product_sl as&lt;BR /&gt;
select pri.product_name as pri_product_name, pro.product_name as pro_product_name&lt;BR /&gt;
from price pri, product pro&lt;BR /&gt;
where pri.product_name =* pro.product_name;&lt;BR /&gt;
quit;&lt;U&gt;&lt;/U&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/* -------------------------------------------------------------------------------- */</description>
      <pubDate>Wed, 18 May 2011 09:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66697#M14475</guid>
      <dc:creator>ChendhilKumar</dc:creator>
      <dc:date>2011-05-18T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66698#M14476</link>
      <description>Check function compare();&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 18 May 2011 10:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Compare-two-variables/m-p/66698#M14476</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-05-18T10:30:08Z</dc:date>
    </item>
  </channel>
</rss>

