<?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 Data comparison in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251358#M268761</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two data sets. One containes a list of formal fortuen 500 companies' name. The other contains patent information for a lot of companies which are extracted online, so the format of the companies' name may differ from the first data set, even if they refer to the same company.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I wanted to do is to select out the patent information for the companies who are among the fortune 500 companies. So, I have to compare the compare the names between the two data sets. I used soundslike (=*) statemete, and treat each of the fortune 500 companies as a macro variable. As the follwoing code shows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt; set company0;&lt;BR /&gt; suffix=put(_n_,5.);&lt;BR /&gt; call symput(cats('company',suffix), company);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data selected_patent;&lt;BR /&gt; set patent0;&lt;BR /&gt; where organization_name =* "&amp;amp;company1.";&lt;BR /&gt; company=put("&amp;amp;company1.", 25.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;company1. stands for the one of the fortune companies, but I have 500 macro variables like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one way I can think of is to run macro program, but I have to list 500 call statement for macro program!!!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any easy way to finish this task, instead of using calling macro program for 500 times?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sherri&lt;/P&gt;</description>
    <pubDate>Sat, 20 Feb 2016 22:43:46 GMT</pubDate>
    <dc:creator>SherriF</dc:creator>
    <dc:date>2016-02-20T22:43:46Z</dc:date>
    <item>
      <title>Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251358#M268761</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have two data sets. One containes a list of formal fortuen 500 companies' name. The other contains patent information for a lot of companies which are extracted online, so the format of the companies' name may differ from the first data set, even if they refer to the same company.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I wanted to do is to select out the patent information for the companies who are among the fortune 500 companies. So, I have to compare the compare the names between the two data sets. I used soundslike (=*) statemete, and treat each of the fortune 500 companies as a macro variable. As the follwoing code shows:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt; set company0;&lt;BR /&gt; suffix=put(_n_,5.);&lt;BR /&gt; call symput(cats('company',suffix), company);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data selected_patent;&lt;BR /&gt; set patent0;&lt;BR /&gt; where organization_name =* "&amp;amp;company1.";&lt;BR /&gt; company=put("&amp;amp;company1.", 25.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;amp;company1. stands for the one of the fortune companies, but I have 500 macro variables like this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one way I can think of is to run macro program, but I have to list 500 call statement for macro program!!!!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any easy way to finish this task, instead of using calling macro program for 500 times?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Sherri&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2016 22:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251358#M268761</guid>
      <dc:creator>SherriF</dc:creator>
      <dc:date>2016-02-20T22:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251364#M268762</link>
      <description>&lt;P&gt;I usually recommend the solution in this thread, primarily FriedEgg's. He also, suggests a open source tool called the Link King, if you can install software. That's usually not an option where I work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Name-matching/td-p/82780" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Name-matching/td-p/82780&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, you might want to consider a data step solution if that's an option. You can load the names into a temporary and loop through them, there should be code that I wrote for that solution somewhere on here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Calling a macro 500 times is easy if you use call execute, but not efficient.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2016 23:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251364#M268762</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-20T23:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251392#M268763</link>
      <description>Am I missing something,  or can't this be solved in a simple SQL join?</description>
      <pubDate>Sun, 21 Feb 2016 09:16:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251392#M268763</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-21T09:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251408#M268764</link>
      <description>No, you didn't miss anything. You are right! I lost myself!!&lt;BR /&gt;&lt;BR /&gt;Thank you!&lt;BR /&gt;Sherri</description>
      <pubDate>Sun, 21 Feb 2016 16:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251408#M268764</guid>
      <dc:creator>SherriF</dc:creator>
      <dc:date>2016-02-21T16:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251411#M268765</link>
      <description>&lt;P&gt;Yes, it's a straightforward SQL, but the next step is typically how do I do this 'fuzzy' comparison with different options which is what FriedEgg's solution covers, using SOUNDEX, COMPGED and other comparison operators.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2016 17:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251411#M268765</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-21T17:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Data comparison</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251414#M268766</link>
      <description>Good resource! Thank you so much! Learned new stuff!!</description>
      <pubDate>Sun, 21 Feb 2016 17:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-comparison/m-p/251414#M268766</guid>
      <dc:creator>SherriF</dc:creator>
      <dc:date>2016-02-21T17:50:14Z</dc:date>
    </item>
  </channel>
</rss>

