<?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: How to find difference values between two columns values regardless of the row orders. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634812#M188419</link>
    <description>&lt;P&gt;By "difference" do you mean a substring separated by comma that appears in one value but not the other?&lt;/P&gt;
&lt;P&gt;What do you want for result if there is no difference? If there are two or more differences?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what do you mean by "regardless of row orders"? Do you mean that you have to compare every value of one variable with every value of the other? You should probably show an example with more than 2 rows of data and the exact expected value for all of the comparisons showing both the starting values for both variables and the desired result. Include at least one example that would have NO difference so we can see what you expect as a result in that case.&lt;/P&gt;
&lt;P&gt;Also, are these variables in the same data set or different data sets?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2020 16:27:44 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-03-25T16:27:44Z</dc:date>
    <item>
      <title>How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634808#M188417</link>
      <description>&lt;P&gt;For Example:&lt;/P&gt;&lt;P&gt;vend_net&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;406,800,802,803,8010&lt;BR /&gt;406,800,802,803,8010&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pract_net&lt;/P&gt;&lt;P&gt;406,800,802,803&lt;BR /&gt;406,800,803,8010&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected ANS:&lt;/P&gt;&lt;P&gt;DIFF&lt;/P&gt;&lt;P&gt;8010&lt;/P&gt;&lt;P&gt;802&lt;/P&gt;&lt;P&gt;So how to find difference value&amp;nbsp;between two column. Can you help me?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634808#M188417</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2020-03-25T16:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634810#M188418</link>
      <description>It is not clear how your data actually looks.  Do you have a character variable with values separated by commas?  Multiple observations? Multiple variables?  &lt;BR /&gt;It is also not clear what your logic is that generates that answer.</description>
      <pubDate>Wed, 25 Mar 2020 16:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634810#M188418</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-25T16:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634812#M188419</link>
      <description>&lt;P&gt;By "difference" do you mean a substring separated by comma that appears in one value but not the other?&lt;/P&gt;
&lt;P&gt;What do you want for result if there is no difference? If there are two or more differences?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And what do you mean by "regardless of row orders"? Do you mean that you have to compare every value of one variable with every value of the other? You should probably show an example with more than 2 rows of data and the exact expected value for all of the comparisons showing both the starting values for both variables and the desired result. Include at least one example that would have NO difference so we can see what you expect as a result in that case.&lt;/P&gt;
&lt;P&gt;Also, are these variables in the same data set or different data sets?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634812#M188419</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-25T16:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634817#M188421</link>
      <description>&lt;P&gt;&lt;SPAN&gt;It is not clear how your data actually looks. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Do you have a character variable with values separated by commas? &lt;STRONG&gt;YES&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Multiple observations? &lt;STRONG&gt;YES&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Multiple variables? &lt;STRONG&gt;Two Variable&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is also not clear what your logic is that generates that answer. It has to find out different value between two variable in one SAS datasets.&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Capture1.PNG" style="width: 200px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37361iACF1A7DF22C60ADB/image-size/small?v=v2&amp;amp;px=200" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:45:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634817#M188421</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2020-03-25T16:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634819#M188422</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 308px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37362i9A9110DB1A1AC78A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expecting the above example.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:47:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634819#M188422</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2020-03-25T16:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634821#M188423</link>
      <description>&lt;P&gt;This produces the original answer.&amp;nbsp; Although you might want to also search in the opposite direction.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
  length vend_net Pract_net Expected $200;
  input vend_net Pract_net Expected;
cards;
406,800,802,803,8010 406,800,802,803 8010
406,800,802,803,8010 406,800,803,8010 802
;

data want;
  set have;
  length diff $200;
  do i=1 to countw(vend_net,', ');
    if not indexw(Pract_net,scan(vend_net,i,', '),', ') then
      diff=catx(',',scan(vend_net,i,', '))
    ;
  end;
run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs          vend_net             Pract_net        Expected    diff    i

 1     406,800,802,803,8010    406,800,802,803       8010      8010    6
 2     406,800,802,803,8010    406,800,803,8010      802       802     6
&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Mar 2020 16:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634821#M188423</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-03-25T16:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634823#M188424</link>
      <description>Thank you So Much</description>
      <pubDate>Wed, 25 Mar 2020 16:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634823#M188424</guid>
      <dc:creator>Spintu</dc:creator>
      <dc:date>2020-03-25T16:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to find difference values between two columns values regardless of the row orders.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634842#M188441</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/39525"&gt;@Spintu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture1.PNG" style="width: 308px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37362i9A9110DB1A1AC78A/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture1.PNG" alt="Capture1.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Expecting the above example.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Still don't see any definition of what "regardless of row orders" means. It appears that only wanted to compare within a single observation (row).&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2020 17:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-difference-values-between-two-columns-values/m-p/634842#M188441</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-03-25T17:43:47Z</dc:date>
    </item>
  </channel>
</rss>

