<?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: Output of Proc Compare get only differences in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/419278#M273108</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181522"&gt;@GAL1986&lt;/a&gt;&amp;nbsp;personally I don't use PROC COMPARE, I would do a custom SQL or data step since PROC COMPARE output is difficult to wrangle. If you really want PROC COMPARE you likely need to take the full data out and restrict the data set in a second data step anyways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Please post your own question, not as a response to a thread that's 9 months old.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181522"&gt;@GAL1986&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;would like to&amp;nbsp;create a dataset that shows the values produced by OUTBASE and OUTCOMP but only for people with unequal values. Is there a way to do this? The following code, even with OUTNOEQUAL, shows the values for all observations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc compare base=HLA_internal_test comp=HLA_external_test out=dif2 outbase outcomp outnoequal;&lt;BR /&gt;ID PID;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2017 18:13:10 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-12-07T18:13:10Z</dc:date>
    <item>
      <title>Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345147#M273099</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to see only records with differences included in my output with the structure shown below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;_TYPE_&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;obs&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;var1&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;var2&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;var3&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;&lt;STRONG&gt;var4&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;BASE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;34&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;115003481&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1214&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;48&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;COMPARE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;34&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;115003481&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1214&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;48&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P&gt;DIF&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;34&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;115003481&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;1214&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;48&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The program used was:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc compare base=F.&amp;amp;MATCH1 compare=F.&amp;amp;MATCH2
  OUT=F.&amp;amp;DIFF 
	outbase
	outcomp
	outdif
;
  id var1 var2 var3 var4 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;                   Number of Observations in Common: 4083722.                                                               
                           Number of Observations in F.MATCH1 but not in F.MATCH2: 158.                           
                           Total Number of Observations Read from F.MATCH1: 4083722.                                        
                           Total Number of Observations Read from F.MATCH2: 4083880.                                      
                                                                                                                                    
                           &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Number of Observations with Some Compared Variables Unequal: 2.  &lt;/STRONG&gt;&lt;/FONT&gt;                                        
                           Number of Observations with All Compared Variables Equal: 4083720.                                       
                                                                                                                                    
                                                                                                                                    
                                                     Values Comparison Summary                                                      
                                                                                                                                    
                                  Number of Variables Compared with All Observations Equal: 173.                                    
                                  Number of Variables Compared with Some Observations Unequal: 2.                                   
                                  Number of Variables with Missing Value Differences: 2.                                            
                                  Total Number of Values which Compare Unequal: 2.                                                  
                                  Maximum Difference: 0.      &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why &amp;nbsp;my output file is generating more than 12 millions of observations -including that are exactly equals in both files- ??, I only want on my ouput file with&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt; unequals&lt;/FONT&gt;&lt;/STRONG&gt; observations, like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;                        Number of Observations with Some Compared Variables Unequal: 2.  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance and regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;JC&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345147#M273099</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-03-28T19:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345151#M273100</link>
      <description>&lt;P&gt;Looking at the documenation (or below in red) you can see why you're getting the behaviour you've described. You can fix this by specifying the OUTNOEQUAL option instead. See the code below.&amp;nbsp;&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="_self"&gt;Documentation for PROC COMPARE:&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H4 class="xis-optionCategory"&gt;&amp;nbsp;&lt;/H4&gt;
&lt;H5 class="xis-option"&gt;&amp;nbsp;&lt;/H5&gt;
&lt;H5 class="xis-option"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/n0c1y14wyd3u7yn1dmfcpaejllsn.htm#n0fu9sdrb70ghon0zz2h3s06qsod" target="_blank"&gt;OUTBASE&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescription"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;writes an observation for each observation in the base data set.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 class="xis-option"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/n0c1y14wyd3u7yn1dmfcpaejllsn.htm#n085r2i9zbzj6hn13vr4ffumpukq" target="_blank"&gt;OUTCOMP&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescription"&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;writes an observation for each observation in the comparison data set&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;H5 class="xis-option"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/n0c1y14wyd3u7yn1dmfcpaejllsn.htm#p01nh91gq6ho4zn165e9c90va9fs" target="_blank"&gt;OUTDIF&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescription"&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;writes an observation to the output data set for each pair of matching observations.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;H5 class="xis-option"&gt;&amp;nbsp;&lt;/H5&gt;
&lt;H5 class="xis-option"&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/70377/HTML/default/n0c1y14wyd3u7yn1dmfcpaejllsn.htm#n0zq71esl1heemn10gf08hck2fyg" target="_blank"&gt;OUTNOEQUAL&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescription"&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;suppresses the writing of observations when all values are equal.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class="xis-shortDescription"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*sample data to check;
data class;
set sashelp.class;

if age=12 then weight=50;
run;

*proc compare test;
proc compare data=class compare=sashelp.class out=check outnoequal ;
id name;
run;

*results;
proc print data=check;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="xis-shortDescription"&gt;&amp;nbsp;&lt;/P&gt;
&lt;H5 class="xis-option"&gt;&amp;nbsp;&lt;/H5&gt;</description>
      <pubDate>Tue, 28 Mar 2017 20:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345151#M273100</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-28T20:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345155#M273101</link>
      <description>&lt;P&gt;Thanks man!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked for me !!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 20:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/345155#M273101</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-03-28T20:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/413227#M273105</link>
      <description>&lt;P&gt;Hi Jcorti,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been using&amp;nbsp;&lt;SPAN&gt;OUTNOEQUAL option while using proc compare and still getting the equal values in the output. Please find attached the screenshot&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 08:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/413227#M273105</guid>
      <dc:creator>Sunboyss30</dc:creator>
      <dc:date>2017-11-14T08:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/413228#M273106</link>
      <description>&lt;P&gt;Hi Reeza,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can give your inputs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2017 08:36:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/413228#M273106</guid>
      <dc:creator>Sunboyss30</dc:creator>
      <dc:date>2017-11-14T08:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/419274#M273107</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;would like to&amp;nbsp;create a dataset that shows the values produced by OUTBASE and OUTCOMP but only for people with unequal values. Is there a way to do this? The following code, even with OUTNOEQUAL, shows the values for all observations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc compare base=HLA_internal_test comp=HLA_external_test out=dif2 outbase outcomp outnoequal;&lt;BR /&gt;ID PID;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 18:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/419274#M273107</guid>
      <dc:creator>GAL1986</dc:creator>
      <dc:date>2017-12-07T18:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Output of Proc Compare get only differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/419278#M273108</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181522"&gt;@GAL1986&lt;/a&gt;&amp;nbsp;personally I don't use PROC COMPARE, I would do a custom SQL or data step since PROC COMPARE output is difficult to wrangle. If you really want PROC COMPARE you likely need to take the full data out and restrict the data set in a second data step anyways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Please post your own question, not as a response to a thread that's 9 months old.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181522"&gt;@GAL1986&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I&amp;nbsp;would like to&amp;nbsp;create a dataset that shows the values produced by OUTBASE and OUTCOMP but only for people with unequal values. Is there a way to do this? The following code, even with OUTNOEQUAL, shows the values for all observations.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc compare base=HLA_internal_test comp=HLA_external_test out=dif2 outbase outcomp outnoequal;&lt;BR /&gt;ID PID;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 18:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Output-of-Proc-Compare-get-only-differences/m-p/419278#M273108</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-12-07T18:13:10Z</dc:date>
    </item>
  </channel>
</rss>

