<?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 results in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278440#M58890</link>
    <description>&lt;P&gt;One of your datasets, specified as compare, appears to have leading spaces.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try try strip or compress to remove the spaces. They may not be spaces but could be tabs or other white space characters so look at the compress options/modifiers if it doesn't work at first. &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jun 2016 05:04:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-06-19T05:04:29Z</dc:date>
    <item>
      <title>Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278436#M58887</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran Proc compare on my data sets. I am attaching the documnet that I am explaning.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the EPOCH values, both in compare dataset and base dataset the values "SCREENING' are same. But the values are not matching and proc compare results &amp;nbsp;shows that compare values for EPOCH='SCREENING' are written on left side and bottom instead of right side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data one;&lt;BR /&gt;length EPOCH $40;&lt;BR /&gt;merge two (in=a) three;&lt;BR /&gt;by id;&lt;BR /&gt;if a;&lt;BR /&gt;if dtn ge sdate and dtn le edate then EPOCH='SCREENING';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 04:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278436#M58887</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-19T04:30:52Z</dc:date>
    </item>
    <item>
      <title>Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278435#M58891</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran Proc compare on my data sets. I am attaching the documnet that I am explaning.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the EPOCH values, both in compare dataset and base dataset the values "SCREENING' are same. But the values are not matching and proc compare results &amp;nbsp;shows that compare values for EPOCH='SCREENING' are written on left side and bottom instead of right side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data one;&lt;BR /&gt;length EPOCH $40;&lt;BR /&gt;merge two (in=a) three;&lt;BR /&gt;by id;&lt;BR /&gt;if a;&lt;BR /&gt;if dtn ge sdate and dtn le edate then EPOCH='SCREENING';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 04:30:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278435#M58891</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-19T04:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278440#M58890</link>
      <description>&lt;P&gt;One of your datasets, specified as compare, appears to have leading spaces.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try try strip or compress to remove the spaces. They may not be spaces but could be tabs or other white space characters so look at the compress options/modifiers if it doesn't work at first. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 05:04:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278440#M58890</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-19T05:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278481#M58901</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to find answer for this question. I could not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are other IF statement for EPOCH. Why only EPOCH='SCREENING' is having the spaces and not matching. Does any body have any answer. I used compress and strip functions. It is still showing same results. Please help. Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 15:17:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278481#M58901</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-19T15:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278486#M58904</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza﻿&lt;/a&gt;&amp;nbsp;already told you what is the most likely cause of the miss match. &amp;nbsp;One of the variables has leading spaces (or other non-graphic characters) and so they are NOT the same value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if 'SCREENING' = '     SCREENING' then put 'FALSE';
else put 'TRUE';
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jun 2016 15:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278486#M58904</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-19T15:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278489#M58905</link>
      <description>&lt;P&gt;I ran the following;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if 'SCREENING' = 'SCREENING' then put 'TRUE';&lt;BR /&gt;else put 'FALSE';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log shows all TRUE. So there are no leading spaces. If any other possibility please help. Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 17:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278489#M58905</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-19T17:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278494#M58906</link>
      <description>&lt;P&gt;Your test is not what you want, of course two strings are equal.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post the the code you used to trim/strip for the dataset that you claim did not work and the corresponding proc compare.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 17:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278494#M58906</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-19T17:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278503#M58907</link>
      <description>&lt;P&gt;My code;&lt;/P&gt;&lt;P&gt;&amp;nbsp;data one;&lt;BR /&gt;length EPOCH1 $40;&lt;BR /&gt;merge two (in=a) three;&lt;BR /&gt;by id;&lt;BR /&gt;if a;&lt;BR /&gt;if dtn ge sdate and dtn le edate then EPOCH1='SCREENING';&lt;/P&gt;&lt;P&gt;if EPOCH1 ^= '' then EPOCH=strip(EPOCH1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2016 18:09:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278503#M58907</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-19T18:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278509#M58908</link>
      <description>&lt;P&gt;Did you check to see if it still has some sort of leading spaces? As I mentioned in my first post, it may not be a space but some other white space character.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Print the value with a hex format to see what it looks like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put epoch hex16.;&lt;/CODE&gt;&lt;/PRE&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 Jun 2016 18:35:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278509#M58908</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-19T18:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278512#M58909</link>
      <description>&lt;P&gt;Take one of the observations where the values do not match and use a PUT statement with $HEX. format to see what values are actually in the strings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set one firstobs=7 obs=7 ;
  put epoch $hex. ;
run;

data _null_;
  set two firstobs=7 obs=7;
  put epoch $hex.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 19 Jun 2016 19:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278512#M58909</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-19T19:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278556#M58912</link>
      <description>&lt;P&gt;Thanks for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ran your code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Hex. format for 'SCREENING' in my data(compare)=53435245454E494E47&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Hex. format for 'SCREENING' in vendor data(base)=53435245454E494E47200A2020202020202020202020202020202020202020202020202020202020&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I have to before comparing the datasets. Please .Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 00:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278556#M58912</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2016-06-20T00:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278557#M58913</link>
      <description>&lt;P&gt;It looks like your base data has trailing spaces. As far as I'm aware that should be ignored in your comparison.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your proc compare code on these datasets gives you differences? Post the full code - including where you do the recode/trim and your output plese.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure to check the specific record numbers it's indicating.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a test case I can't replicate your issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data1;
length epoch $20.;
epoch='Screening     ';
run;

data data2;
length epoch $9.;
epoch='Screening';
run;

proc compare base=data1 compare=data2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jun 2016 00:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278557#M58913</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-20T00:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc compare results</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278646#M58925</link>
      <description>&lt;P&gt;The second one has a linefeed ('0A'x) character in the middle of it.&lt;/P&gt;
&lt;P&gt;You can use COMPRESS() function to remove it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X = COMPRESS(X,'0A'x);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2016 12:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-compare-results/m-p/278646#M58925</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-06-20T12:17:24Z</dc:date>
    </item>
  </channel>
</rss>

