<?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: deal with the variations in merge in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75891#M22026</link>
    <description>I Don't know how much it will help to you....&lt;BR /&gt;
&lt;BR /&gt;
From A.csv file split the name in to two parts by using scan function like Toyota and carmy as name1 and name2.&lt;BR /&gt;
from B.csv file also do same thing.&lt;BR /&gt;
&lt;BR /&gt;
finally merge by either name1 or name2 ........&lt;BR /&gt;
&lt;BR /&gt;
Thanks....</description>
    <pubDate>Mon, 02 Mar 2009 09:52:30 GMT</pubDate>
    <dc:creator>venkatesh</dc:creator>
    <dc:date>2009-03-02T09:52:30Z</dc:date>
    <item>
      <title>deal with the variations in merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75890#M22025</link>
      <description>I think this is a very challenging problem I am facing and I have no idea how to deal with it&lt;BR /&gt;
Suppose I have two csv files&lt;BR /&gt;
&lt;BR /&gt;
A.csv&lt;BR /&gt;
Toyota Camry,1998,blue &lt;BR /&gt;
Honda Civic,1999,blue&lt;BR /&gt;
Acura Inf,2000,yellow&lt;BR /&gt;
&lt;BR /&gt;
B.csv&lt;BR /&gt;
Toyota Inc. Camry, 2000km&lt;BR /&gt;
Honda Corp Civic,1500km&lt;BR /&gt;
HondaUSA Inf, 2000, 2300km&lt;BR /&gt;
&lt;BR /&gt;
I want to generate C.csv&lt;BR /&gt;
Toyota Camry,1998,blue ,2000km&lt;BR /&gt;
Honda Civic,1999,blue,1500km&lt;BR /&gt;
HondaUSA Inf,2000,yellow,2300km&lt;BR /&gt;
&lt;BR /&gt;
The worst part of the task is that there needs to be error tolerance to deal with the variations in the company name&lt;BR /&gt;
1.extra spaces&lt;BR /&gt;
2.extra dots&lt;BR /&gt;
3.phrases such as Inc, corp. &lt;BR /&gt;
4.Create a list of manual translation tables(Acura translates to HondaUSA)&lt;BR /&gt;
&lt;BR /&gt;
Is this mission impossible?</description>
      <pubDate>Mon, 02 Mar 2009 00:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75890#M22025</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-02T00:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: deal with the variations in merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75891#M22026</link>
      <description>I Don't know how much it will help to you....&lt;BR /&gt;
&lt;BR /&gt;
From A.csv file split the name in to two parts by using scan function like Toyota and carmy as name1 and name2.&lt;BR /&gt;
from B.csv file also do same thing.&lt;BR /&gt;
&lt;BR /&gt;
finally merge by either name1 or name2 ........&lt;BR /&gt;
&lt;BR /&gt;
Thanks....</description>
      <pubDate>Mon, 02 Mar 2009 09:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75891#M22026</guid>
      <dc:creator>venkatesh</dc:creator>
      <dc:date>2009-03-02T09:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: deal with the variations in merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75892#M22027</link>
      <description>It looks a little complicated but by no means mission impossible.&lt;BR /&gt;
&lt;BR /&gt;
You obviously need to get a standardised variable in each dataset (having read them in from the csv files.&lt;BR /&gt;
&lt;BR /&gt;
Have a look at the INDEXW function...&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000212235.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000212235.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
This will search a string for a specific word.&lt;BR /&gt;
&lt;BR /&gt;
You could create a list of words you are looking for e.g. Honda Acura Nissan&lt;BR /&gt;
&lt;BR /&gt;
and use the indexw function to look for them in the variable. If you find the word then put that word into a variable. Do this on both datasets, then change any Accura to to Honda etc.&lt;BR /&gt;
&lt;BR /&gt;
Remember the INDEXW function is looking for words, so it uses a delimiter. So it won't pick the Honda out of HondaUSA. It is looking for words, not character strings. You can use regular expressions for that if you are really keen.&lt;BR /&gt;
&lt;BR /&gt;
When you have a standard variable in each data set you can merge them.</description>
      <pubDate>Tue, 03 Mar 2009 10:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75892#M22027</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-03T10:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: deal with the variations in merge</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75893#M22028</link>
      <description>Just a random thought, but have you given the Sounds-Like  (=*) opperator a try?  Also, you can use Regular expressions to match oun similar text.</description>
      <pubDate>Tue, 03 Mar 2009 12:48:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/deal-with-the-variations-in-merge/m-p/75893#M22028</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-03-03T12:48:03Z</dc:date>
    </item>
  </channel>
</rss>

