<?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: Compare data value from 2 datasets in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340739#M22584</link>
    <description>&lt;P&gt;Simple change, you should be able to find this yourself:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data checked;
merge
  dubious (in=d)
  correct (in=c rename=(country=_country))
;
by state;
if d;
if c and country ne _country;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result now is this:&lt;/P&gt;
&lt;PRE&gt;country    state         _country

France     California       US   
UK         Nevada           US   
&lt;/PRE&gt;</description>
    <pubDate>Tue, 14 Mar 2017 11:39:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-03-14T11:39:26Z</dc:date>
    <item>
      <title>Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340714#M22580</link>
      <description>&lt;P&gt;&amp;nbsp;I have 2 datasets. In one dataset we have correct data for example: states falls in country variable. and in another dataset we have incorrect data for example few of the states falls into wrong country. I want to check that incorrect data. How to do that??&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 20:08:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340714#M22580</guid>
      <dc:creator>Neha2</dc:creator>
      <dc:date>2017-03-18T20:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340720#M22582</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data correct;
input country :$20. state :$20.;
cards;
US Nevada
Austria Tirol
US California
;
run;

data dubious;
input country :$20. state :$20.;
cards;
UK Nevada
Austria Tirol
France California
;
run;

proc sort data=correct;
by state;
run;

proc sort data=dubious;
by state;
run;

data checked;
merge
  dubious (in=d)
  correct (in=c rename=(country=_country))
;
by state;
if d;
if c and country ne _country then country = _country;
drop _country;
run;

proc print data=checked noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This results in:&lt;/P&gt;
&lt;PRE&gt;country    state

US         California
US         Nevada    
Austria    Tirol     
&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 10:04:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340720#M22582</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-14T10:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340721#M22583</link>
      <description>&lt;P&gt;I need only incorrect data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 10:08:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340721#M22583</guid>
      <dc:creator>Neha2</dc:creator>
      <dc:date>2017-03-14T10:08:30Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340739#M22584</link>
      <description>&lt;P&gt;Simple change, you should be able to find this yourself:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data checked;
merge
  dubious (in=d)
  correct (in=c rename=(country=_country))
;
by state;
if d;
if c and country ne _country;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The result now is this:&lt;/P&gt;
&lt;PRE&gt;country    state         _country

France     California       US   
UK         Nevada           US   
&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Mar 2017 11:39:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340739#M22584</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-14T11:39:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340788#M22586</link>
      <description>&lt;P&gt;It is a &lt;STRONG&gt;very&lt;/STRONG&gt; good idea to provide some example data and the final result for your example data.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 14:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/340788#M22586</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-14T14:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342228#M22655</link>
      <description>&lt;P&gt;Thanks. Its working.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 10:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342228#M22655</guid>
      <dc:creator>Neha2</dc:creator>
      <dc:date>2017-03-18T10:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342229#M22656</link>
      <description>Can we do the same for 3 variables?? As in we have one more variable name city it should also mapped correctly. I tried but then its not working. Can we do that by creating macro??&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Mar 2017 10:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342229#M22656</guid>
      <dc:creator>Neha2</dc:creator>
      <dc:date>2017-03-18T10:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Compare data value from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342234#M22657</link>
      <description>&lt;P&gt;Just to repeat what &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; said:&lt;/P&gt;
&lt;P&gt;"It is a &lt;STRONG&gt;very&lt;/STRONG&gt; good idea to provide some example data and the final result for your example data."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't make us do all your work for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the macro provided here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; to convert your example dataset into a data step for posting here.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2017 12:33:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Compare-data-value-from-2-datasets/m-p/342234#M22657</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-18T12:33:02Z</dc:date>
    </item>
  </channel>
</rss>

