<?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 compare variables and notify when they are different from each other in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/compare-variables-and-notify-when-they-are-different-from-each/m-p/539795#M148801</link>
    <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I compare new_variable with the old_variable and show whether they have been changed( create a notification variable, say '1' if the new_variable is different from the old_variable, say '0' if both variables are the same.) The variables are different when they are&amp;nbsp;the same word but different case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example, I expect to get the following result,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;old_variable new_variable notification&lt;/P&gt;&lt;P&gt;apple Apple 1&lt;/P&gt;&lt;P&gt;juice juice 0&lt;/P&gt;&lt;P&gt;Original&amp;nbsp;Original 0&lt;/P&gt;&lt;P&gt;mango&amp;nbsp;nango 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-sas"&gt;data have;
length 
old_variable $20 
new_variable $20 ;
input 
old_variable 
new_variable ;
cards;
apple Apple
juice juice 
Original Original 
mango nango 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me some suggestions about this?&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2019 22:57:49 GMT</pubDate>
    <dc:creator>Alexxxxxxx</dc:creator>
    <dc:date>2019-03-01T22:57:49Z</dc:date>
    <item>
      <title>compare variables and notify when they are different from each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-variables-and-notify-when-they-are-different-from-each/m-p/539795#M148801</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how can I compare new_variable with the old_variable and show whether they have been changed( create a notification variable, say '1' if the new_variable is different from the old_variable, say '0' if both variables are the same.) The variables are different when they are&amp;nbsp;the same word but different case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example, I expect to get the following result,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;old_variable new_variable notification&lt;/P&gt;&lt;P&gt;apple Apple 1&lt;/P&gt;&lt;P&gt;juice juice 0&lt;/P&gt;&lt;P&gt;Original&amp;nbsp;Original 0&lt;/P&gt;&lt;P&gt;mango&amp;nbsp;nango 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class="language-sas"&gt;data have;
length 
old_variable $20 
new_variable $20 ;
input 
old_variable 
new_variable ;
cards;
apple Apple
juice juice 
Original Original 
mango nango 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please give me some suggestions about this?&lt;/P&gt;&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 22:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-variables-and-notify-when-they-are-different-from-each/m-p/539795#M148801</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-03-01T22:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: compare variables and notify when they are different from each other</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-variables-and-notify-when-they-are-different-from-each/m-p/539801#M148805</link>
      <description>&lt;P&gt;A simple comparison between the variables should do.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  length 
    old_variable $20 
    new_variable $20;
  input 
    old_variable 
    new_variable;

  change_flag= (old_variable ne new_variable);
  cards;
apple Apple
juice juice 
Original Original 
mango nango 
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What below line does:&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;change_flag= (old_variable ne new_variable);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;old_variable ne new_variable - &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Expression to compare the content in the two variables. The expression returns 1 (TRUE) if there is a difference and 0 (FALSE) if there is no difference&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;change_flag=&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Variable to assign the result to from the result of the expression to the right of the equal sign.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 23:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-variables-and-notify-when-they-are-different-from-each/m-p/539801#M148805</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-03-01T23:08:45Z</dc:date>
    </item>
  </channel>
</rss>

