<?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: Proc compare - decimal in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897137#M354521</link>
    <description>Thanks for the quick response.&lt;BR /&gt;&lt;BR /&gt;For example ×=200 , b=220&lt;BR /&gt;&lt;BR /&gt;While comparing , it shows like below&lt;BR /&gt;X B diff&lt;BR /&gt;200.000 220.000 -20.000&lt;BR /&gt;&lt;BR /&gt;How to ignore the last decimal points, need to see like below&lt;BR /&gt;&lt;BR /&gt;X B diff&lt;BR /&gt;200 220 -20&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 04 Oct 2023 12:54:54 GMT</pubDate>
    <dc:creator>SireeshaKarthik</dc:creator>
    <dc:date>2023-10-04T12:54:54Z</dc:date>
    <item>
      <title>Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897131#M354518</link>
      <description>Hi, the results for a proc compare , some numeric values are showing extra three decimal points by default. How I can ignore the extra decimals</description>
      <pubDate>Wed, 04 Oct 2023 12:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897131#M354518</guid>
      <dc:creator>SireeshaKarthik</dc:creator>
      <dc:date>2023-10-04T12:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897136#M354520</link>
      <description>&lt;P&gt;Can you add a little example of what you mean?&amp;nbsp; Do you mean you have data where the only difference is in the third decimal place, like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a ;
  x=1.501 ;
run ;

data b ;
 x=1.502 ;
run ;

proc compare base=a compare=b ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And you want PROC COMPARE&amp;nbsp; to report that those two values are equal? If that's what you mean, look into the CRITERION option.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 12:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897136#M354520</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-10-04T12:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897137#M354521</link>
      <description>Thanks for the quick response.&lt;BR /&gt;&lt;BR /&gt;For example ×=200 , b=220&lt;BR /&gt;&lt;BR /&gt;While comparing , it shows like below&lt;BR /&gt;X B diff&lt;BR /&gt;200.000 220.000 -20.000&lt;BR /&gt;&lt;BR /&gt;How to ignore the last decimal points, need to see like below&lt;BR /&gt;&lt;BR /&gt;X B diff&lt;BR /&gt;200 220 -20&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Oct 2023 12:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897137#M354521</guid>
      <dc:creator>SireeshaKarthik</dc:creator>
      <dc:date>2023-10-04T12:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897139#M354522</link>
      <description>&lt;P&gt;You can add a FORMAT statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a ;
  x=200 ;
run ;

data b ;
 x=220 ;
run ;

proc compare base=a compare=b ;
  format x 8. ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That doesn't impact the comparison, but will show X formatted with no decimal places:&lt;/P&gt;
&lt;PRE&gt;          ||       Base    Compare
      Obs ||          x          x      Diff.     % Diff
________  ||  _________  _________  _________  _________
          ||
       1  ||        200        220    20.0000    10.0000
_________________________________________________________
&lt;/PRE&gt;
&lt;P&gt;The difference still shows decimal places.&amp;nbsp; If you don't want that, you might be able to edit a table template or something like that.&amp;nbsp; I don't see a MAXDEC option or similar for PROC COMPARE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 13:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897139#M354522</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-10-04T13:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897154#M354527</link>
      <description>Yes. We can use maxdec for proc report, the variable has already format 8.&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Oct 2023 13:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897154#M354527</guid>
      <dc:creator>SireeshaKarthik</dc:creator>
      <dc:date>2023-10-04T13:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare - decimal</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897156#M354529</link>
      <description>&lt;P&gt;Apparently PROC COMPARE does not actually use a table template, so I'm not sure you can fully customize this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this paper by the great Jane Eslinger, which has a section on COMPARE&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.pharmasug.org/proceedings/2019/BP/PharmaSUG-2019-BP-039.pdf" target="_blank"&gt;https://www.pharmasug.org/proceedings/2019/BP/PharmaSUG-2019-BP-039.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jane suggests for custom output from PROC COMPARE, you may want to output the results to a dataset, then use PROC REPORT or whatever to display they results.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 13:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-compare-decimal/m-p/897156#M354529</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-10-04T13:58:10Z</dc:date>
    </item>
  </channel>
</rss>

