<?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 discrepancy for alignment in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819831#M34785</link>
    <description>&lt;P&gt;Help you do what? PROC COMPARE is accurately reporting that you have left aligned your character columns but your production programmer hasn't. First decide how you want to align your data then ensure the production version and your version apply the same SAS statements to do that.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jun 2022 21:15:36 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-06-22T21:15:36Z</dc:date>
    <item>
      <title>Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819826#M34783</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running a report for proc compare. I check manually all the values are exactly matching but still proc compare is showing discrepancy for 0 (zero) value only.&lt;/P&gt;&lt;P&gt;and I use compress, strip, left, all type of functions to remove extra spaces so that I will get 100% match for proc compare.&lt;/P&gt;&lt;P&gt;But still there is leading blanks for record label. I am having same issue for other table also. compare dataset is generated by me and base is by production programmer&lt;/P&gt;&lt;P&gt;can somebody help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yogita_patel_0-1655931222787.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/72615i4E3E2E06C4A46A1B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yogita_patel_0-1655931222787.png" alt="yogita_patel_0-1655931222787.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 20:56:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819826#M34783</guid>
      <dc:creator>yogita_patel</dc:creator>
      <dc:date>2022-06-22T20:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819830#M34784</link>
      <description>&lt;P&gt;Data. Data. Data.&amp;nbsp;&amp;nbsp; Instructions 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; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code used for the&amp;nbsp; attempt to clean up your values and then compare.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:09:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819830#M34784</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-22T21:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819831#M34785</link>
      <description>&lt;P&gt;Help you do what? PROC COMPARE is accurately reporting that you have left aligned your character columns but your production programmer hasn't. First decide how you want to align your data then ensure the production version and your version apply the same SAS statements to do that.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:15:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819831#M34785</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-22T21:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819835#M34786</link>
      <description>I use compress, strip, left function to align data to left but for production strip or left is not working. only compress is working.</description>
      <pubDate>Wed, 22 Jun 2022 21:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819835#M34786</guid>
      <dc:creator>yogita_patel</dc:creator>
      <dc:date>2022-06-22T21:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819837#M34787</link>
      <description>&lt;P&gt;If you use exactly the same logic as your production program and exactly the same input dataset, you should get the same output data. If this is not the case then I can only assume the input data is different.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 21:35:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819837#M34787</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-22T21:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819840#M34788</link>
      <description>I checked manually all values and labels are exactly same.</description>
      <pubDate>Wed, 22 Jun 2022 21:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819840#M34788</guid>
      <dc:creator>yogita_patel</dc:creator>
      <dc:date>2022-06-22T21:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819846#M34789</link>
      <description>&lt;P&gt;If you can't remove leading blanks it suggest there are no leading blanks.&amp;nbsp; Perhaps the non-breaking space.&amp;nbsp; Look at your data with $HEX format.&lt;/P&gt;
&lt;P&gt;Better yet, show us the data using $HEX format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 22:23:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819846#M34789</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-06-22T22:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819847#M34790</link>
      <description>&lt;P&gt;Does that include data alignment? If values are the same but alignment is different then character data values are NOT identical. For example 'ABC' (no blank spaces) is not the same as ' ABC' (one leading blank space).&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 22:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819847#M34790</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-22T22:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819848#M34791</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/398177"&gt;@yogita_patel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I checked manually all values and labels are exactly same.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We routinely deal with people on this forum that claim there data is a Date value (which means some specific ranges of numeric values) and after 20 or more questions the values turn out to be character. Or a format is applied that will display values for print that "manually are exactly the same" but in reality are not. There are a number of other things that "manual" comparison, especially if it means looking at printed output and thinking it is identical. Even worse: exported to Excel and then looked at as Excel is known to apply all sorts of rules to things and change values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Compare is &lt;STRONG&gt;old&lt;/STRONG&gt;. What that means is that it has been tested and used for well over 30 years. It does not make up differences to report. You need to provide some concrete example of the data processed that you claim is identical and the code used to compare it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case I think actual sas7bdat files may be needed. Subset a few records and variable that demonstrate the difference. Provide the starting data and the code used to prepare them for Proc Compare and the Compare code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, when you say LABEL are you referring to SAS variable labels? SAS data set Labels? or the values of one of your variables in a data set?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2022 22:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/819848#M34791</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-22T22:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820132#M34805</link>
      <description>can i remove or add $HEX format? as I dont see code for production programmer. I have only final dataset.</description>
      <pubDate>Thu, 23 Jun 2022 19:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820132#M34805</guid>
      <dc:creator>yogita_patel</dc:creator>
      <dc:date>2022-06-23T19:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820239#M34812</link>
      <description>&lt;P&gt;You can display your data (proc print) and assign format.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print;
   format _char_ $hex.;
   run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jun 2022 13:47:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820239#M34812</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2022-06-24T13:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare discrepancy for alignment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820248#M34813</link>
      <description>&lt;P&gt;For COL2 this simple test should tell you want is happening.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=BASE;
  tables col2 ;
 format col2 $hex4.;
run;
proc freq data=COMPARE;
  tables col2 ;
 format col2 $hex4.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So it looks like the dataset on the right has a lot of observations with leading spaces, which will display as '2020' using $HEX4.&amp;nbsp; format.&amp;nbsp; &amp;nbsp;If instead you see a lot of values of '0909' or 'A0A0' then you know that the those characters are NOT spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If COL3 is also character then do the same.&amp;nbsp; If it is numeric try using HEX16. format instead.&amp;nbsp; If the value is actually zero it will print as 16 zeros.&amp;nbsp; If it is some very small number it will print as something else.&lt;/P&gt;
&lt;PRE&gt;1637  data test;
1638    do col3=0,1E-20;
1639      put col3=4. col3 hex16.;
1640    end;
1641  run;

col3=0 0000000000000000
col3=0 3BC79CA10C924223
&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jun 2022 14:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-compare-discrepancy-for-alignment/m-p/820248#M34813</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-24T14:04:50Z</dc:date>
    </item>
  </channel>
</rss>

