<?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: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342366#M272832</link>
    <description>&lt;P&gt;Here's a simple way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data checklist (keep=var1-var3);&lt;/P&gt;
&lt;P&gt;set two (keep=var1-var6);&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;var1=var4;&lt;/P&gt;
&lt;P&gt;var2=var5;&lt;/P&gt;
&lt;P&gt;var3=var6;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=checklist nodupkey;&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=one;&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mismatch;&lt;/P&gt;
&lt;P&gt;merge one checklist (in=on_the_master);&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;if on_the_master=0;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data sets are small enough that "easiest to follow" is more important than "speediest to run".&lt;/P&gt;</description>
    <pubDate>Sun, 19 Mar 2017 16:48:14 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-03-19T16:48:14Z</dc:date>
    <item>
      <title>mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342325#M272825</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; need to generate a mismatch report by comparing&amp;nbsp; three variable values (one set)&amp;nbsp;from one dataset with&amp;nbsp; 2 sets&amp;nbsp; of variable values in a different dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example Dataset one has var1 var2 var3 etc. and dataset two has&amp;nbsp; var1 var2 var3&amp;nbsp; var4 var5 var6 etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to check whether&amp;nbsp; (one.var1 one.var2 and one. var3 )matches with( two. var1,two.var2 two.var3) or (two. var4, two.var5, two.var6) and generate a mismatch report having only mismatches(fallouts). of one.var1 onevar2 and one var3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering what could be&amp;nbsp;the best way(efficient way) to program this scenaro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&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>Sun, 19 Mar 2017 04:00:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342325#M272825</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-19T04:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342326#M272826</link>
      <description>&lt;P&gt;How many records in each dataset and is there an ID variable or, if not, are both datasets' records in the same order?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 04:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342326#M272826</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-19T04:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342327#M272827</link>
      <description>&lt;P&gt;Depending upon your answer, and whether the report has to be detailed (and, if so, to what level of specificity), you might be able to get by with something as simple as:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data one;
  input var1-var3;
  cards;
1 1 1
2 1 2
1 2 1
;
data two;
  input var1-var6;
  cards;
1 1 1 1 1 1
2 1 2 2 2 2
1 2 1 1 2 2
;

data both (keep=var1-var3 match);
  set one;
  set two (rename=(var1=_var1 var2=_var2 var3=_var3));
  array one(3) var1-var3;
  array twoa(3) _var1-_var3;
  array twob(3)  var4-var6;
  do i=1 to 3;
    if one(i) ne twoa(i) or one(i) ne twob(i) then match='mismatch';
  end;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 04:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342327#M272827</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-19T04:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342328#M272828</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks art297!!&lt;/P&gt;&lt;P&gt;There&amp;nbsp;are no ID variables In my dataset&amp;nbsp;&amp;nbsp;and order is also not same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I need to check is whether the value of (&amp;nbsp;one.var1 ||one. var2||one.var3) eq (two.var1||two.var2||two.var3) OR&lt;/P&gt;&lt;P&gt;(&amp;nbsp;one.var1 ||one. var2||one.var3) eq (&amp;nbsp;two.var4 ||two. var5||two.var6)&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Right now I have 150 obs in data one and&amp;nbsp; data two is master dataset which has 500 obs .&lt;/P&gt;&lt;P&gt;Note: one.var3 two.var3 two.var6&amp;nbsp; might have missing values .&lt;/P&gt;&lt;P&gt;I have used proc sql with&amp;nbsp;except operator but not sure whether my approach is right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;NAV&lt;/P&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;&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>Sun, 19 Mar 2017 04:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342328#M272828</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-19T04:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342329#M272829</link>
      <description>Thank you very much!!&lt;BR /&gt;Will try this and let you know. I need only mismatches of dataset one. with var1 var2 and var3 .along with comments column where I need to specify which variable/variables not found in dataset two .</description>
      <pubDate>Sun, 19 Mar 2017 04:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342329#M272829</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-19T04:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342330#M272830</link>
      <description>&lt;P&gt;The COMPARE procedure can also do this. I reckon it is one of SAS's best kept "secrets".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n0c1y14wyd3u7yn1dmfcpaejllsn.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/viewer.htm#n0c1y14wyd3u7yn1dmfcpaejllsn.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 05:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342330#M272830</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2017-03-19T05:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342354#M272831</link>
      <description>&lt;P&gt;To insure we're all on the same page, consider the following two datasets:&lt;/P&gt;
&lt;PRE&gt;data one;
  input var1-var3;
  cards;
1 1 1
2 1 2
1 2 1
;
data two;
  input var1-var6;
  cards;
1 1 1 1 1 1
2 1 2 2 2 2
1 2 1 1 2 2
1 1 1 1 1 1
2 1 2 2 4 2
1 2 1 1 2 2
1 1 1 1 1 1
2 1 2 2 2 1
1 2 1 1 2 3
;
&lt;/PRE&gt;
&lt;P&gt;Given those two data sets, show us what you want your output to look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 14:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342354#M272831</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-19T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342366#M272832</link>
      <description>&lt;P&gt;Here's a simple way:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data checklist (keep=var1-var3);&lt;/P&gt;
&lt;P&gt;set two (keep=var1-var6);&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;var1=var4;&lt;/P&gt;
&lt;P&gt;var2=var5;&lt;/P&gt;
&lt;P&gt;var3=var6;&lt;/P&gt;
&lt;P&gt;output;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=checklist nodupkey;&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=one;&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mismatch;&lt;/P&gt;
&lt;P&gt;merge one checklist (in=on_the_master);&lt;/P&gt;
&lt;P&gt;by var1 var2 var3;&lt;/P&gt;
&lt;P&gt;if on_the_master=0;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data sets are small enough that "easiest to follow" is more important than "speediest to run".&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 16:48:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342366#M272832</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-19T16:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342393#M272833</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Sorry &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt; I should have given &amp;nbsp;dummy data &amp;nbsp;to avoid confusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 02:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342393#M272833</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-20T02:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342399#M272834</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/43816"&gt;@Nav&lt;/a&gt;: One aspect of your approach surprizes me as, earlier, you said that dataset one was the smaller of the two. Is it the one that has the desired entries and are their duplicates and/or conflicts within its entries?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, is case relevant or irrelevant?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 21:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342399#M272834</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-19T21:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342402#M272835</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13711"&gt;@art297&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes Dataset one is smaller &amp;nbsp;.In the example I have provided I didn't create lots of observations for dataset two, however &amp;nbsp;Dataset two has lots of observations .&lt;/P&gt;&lt;P&gt;Each observation of dataset one( var1 var2 var3) should be compared with two sets in data two &amp;nbsp;and if there is mismatch then&amp;nbsp;&lt;/P&gt;&lt;P&gt;only mismatched observations of dataset one should be in &amp;nbsp;the &amp;nbsp;mismatch dataset.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes &amp;nbsp;it is Case relevant !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!!&lt;/P&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2017 21:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342402#M272835</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-19T21:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: mismatch report with 1 set of 3 variables from one dataset with two sets  in other dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342406#M272836</link>
      <description>&lt;P&gt;NAV@ ASTOUNDING,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you ! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Simple and smart solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Seems I am thinking too much and making it more complicated .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried and compared with my other program output where I have used Except operator.&lt;/P&gt;&lt;P&gt;GOT the same results as your program .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much everyone &amp;nbsp;for all your valuable time and &amp;nbsp;suggestions .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KIND REGARDS&lt;/P&gt;&lt;P&gt;NAV&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2017 02:46:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/mismatch-report-with-1-set-of-3-variables-from-one-dataset-with/m-p/342406#M272836</guid>
      <dc:creator>Nav</dc:creator>
      <dc:date>2017-03-20T02:46:56Z</dc:date>
    </item>
  </channel>
</rss>

