<?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: Is there a way for sas to output what records didn't match and why? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793917#M254519</link>
    <description>Several hundred thousand records should not be an issue, unless you're using Academics on Demand. &lt;BR /&gt;&lt;BR /&gt;You're not really merging here with a SET statement, you're interleaving. Are you sure you have the correct code?&lt;BR /&gt;What happens if you change SET to MERGE instead?&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 01 Feb 2022 22:22:12 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-02-01T22:22:12Z</dc:date>
    <item>
      <title>Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793858#M254495</link>
      <description>&lt;P&gt;For my work I've been asked to check the data quality of older legacy records against another separate database as there has been concerns on the quality of information when those were brought into the current system. I've currently mostly done match merging based on selected identifiers to provide the team with records that are consistent between the two datasets and separate out records that are failing on one of that list but I've been asked if it's possible to identify where the mismatch in records is occurring as some look like they should be merging properly but aren't. I do not know if it's possible for sas to output it's decision making process during the match but if so that would be very helpful.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 18:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793858#M254495</guid>
      <dc:creator>jmarnaez</dc:creator>
      <dc:date>2022-02-01T18:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793866#M254497</link>
      <description>&lt;P&gt;Can you show the code you are using for the match merging?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using a data step with a MERGE, it's pretty straight forward to output the records that don't match.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure what you mean by "why" or the "decision-making process."&amp;nbsp; If you've got a simple match-merge, the decision making process is, do they or do they not match on all the specified BY variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A small example of data you are comparing might also help.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 18:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793866#M254497</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-02-01T18:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793870#M254498</link>
      <description>PROC COMPARE may be what you're looking for with a BY statement.</description>
      <pubDate>Tue, 01 Feb 2022 19:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793870#M254498</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-01T19:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793916#M254518</link>
      <description>&lt;P&gt;data merged;&lt;/P&gt;&lt;P&gt;set x y;&lt;/P&gt;&lt;P&gt;by a b c d e f;&lt;/P&gt;&lt;P&gt;if in1 and in2;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the basic structure of the code I'm running. outputting the ones that don't match isn't the issue. I'm trying to see if I can get SAS to show where things are not matching for the records versus being able to tell that the unmatched records are failing at a, b, c, d, e, or f but not knowing without physically checking which one is the fault point. I'm giving proc compare a try as recommended below but it's tended to crash the program as the files are several hundred thousand records each.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 22:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793916#M254518</guid>
      <dc:creator>jmarnaez</dc:creator>
      <dc:date>2022-02-01T22:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793917#M254519</link>
      <description>Several hundred thousand records should not be an issue, unless you're using Academics on Demand. &lt;BR /&gt;&lt;BR /&gt;You're not really merging here with a SET statement, you're interleaving. Are you sure you have the correct code?&lt;BR /&gt;What happens if you change SET to MERGE instead?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2022 22:22:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793917#M254519</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-01T22:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793919#M254521</link>
      <description>&lt;P&gt;I suggest you make a little example with, say 5-10 records in work.x and 5-10 records in work.y, with just three by-variables a b c.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then think about how to operationalize the "fault point".&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would need a rule, like "if a record from work.x doesn't match to a record in work.y by A B C but it does match to a record by A B, then the fault point is C."&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 22:25:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793919#M254521</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-02-01T22:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793921#M254522</link>
      <description>&lt;P&gt;Whoop that is meant to be merge. Thank you for noting that.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 22:28:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793921#M254522</guid>
      <dc:creator>jmarnaez</dc:creator>
      <dc:date>2022-02-01T22:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793982#M254543</link>
      <description>&lt;P&gt;First, keep your non-matches:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data non-match;
merge
  x (in=in1)
  y (in=in2)
;
by a b c d e f;
if in1 ne in2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then start by finding multiples when grouping along subsets of key variables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table try_b as
  select *, count(*) as count
  from non-match
  group by a,c,d,e,f
  having count &amp;gt; 1
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;See if this leads you somewhere.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 08:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793982#M254543</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-02T08:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way for sas to output what records didn't match and why?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793993#M254548</link>
      <description>&lt;P&gt;I like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;'s approach for getting&amp;nbsp; sense of your data, and starting to think about why records don't match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think another way to approach this would be as a fuzzy-merging problem.&amp;nbsp; So you would take the mismatches from x and the mismatches from y, and then try to join them by fuzzy-merging by a,b,c,d,e,f.&amp;nbsp; If you go to lexjansen.com and look up fuzzy merge or fuzzy join, you should get plenty of ideas.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 12:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-for-sas-to-output-what-records-didn-t-match-and/m-p/793993#M254548</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-02-02T12:06:55Z</dc:date>
    </item>
  </channel>
</rss>

