<?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 print out the differences in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623172#M183405</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile cards truncover;
input (Fruit1	Fruit2	Fruit3	Fruit4) (:$20.);
cards;
apple	pear	apple	apples
pear	blueberry	pears	pears
banana	strawberry	avocado	Banana
avocado	grape	blueberry	avocado
grape	apple	strawberry	 
 .	. 	grape	. . 
 .	 .	date	 . .
	 ;


data want;
 if _n_=1 then do;
   dcl hash H (dataset:'have') ;
   h.definekey  ("fruit1") ;
   h.definedone () ;
 end;
  set have;
 array ff fruit2-fruit4;
 array f $20 fruit_diff2-fruit_diff4;
 do over f;
  if h.check(key:ff) ne 0 then f=ff;
 end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Feb 2020 21:23:14 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2020-02-07T21:23:14Z</dc:date>
    <item>
      <title>How to print out the differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623170#M183404</link>
      <description>&lt;P&gt;Hi SAS Pros,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to compare the difference between the responses of some variables and get the difference printed out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are a series variables titled fruit1 fruit2 fruit3 fruit4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what I have:&lt;/P&gt;
&lt;TABLE width="353"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="84"&gt;Fruit1&lt;/TD&gt;
&lt;TD width="97"&gt;Fruit2&lt;/TD&gt;
&lt;TD width="77"&gt;Fruit3&lt;/TD&gt;
&lt;TD width="95"&gt;Fruit4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;apple&lt;/TD&gt;
&lt;TD&gt;pear&lt;/TD&gt;
&lt;TD&gt;apple&lt;/TD&gt;
&lt;TD&gt;apples&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;pear&lt;/TD&gt;
&lt;TD&gt;blueberry&lt;/TD&gt;
&lt;TD&gt;pears&lt;/TD&gt;
&lt;TD&gt;pears&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;banana&lt;/TD&gt;
&lt;TD&gt;strawberry&lt;/TD&gt;
&lt;TD&gt;avocado&lt;/TD&gt;
&lt;TD&gt;Banana&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;avocado&lt;/TD&gt;
&lt;TD&gt;grape&lt;/TD&gt;
&lt;TD&gt;blueberry&lt;/TD&gt;
&lt;TD&gt;avocado&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;grape&lt;/TD&gt;
&lt;TD&gt;apple&lt;/TD&gt;
&lt;TD&gt;strawberry&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;grape&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;date&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to compare fruit2 fruit3 and fruit4 against fruit1 and print out anyone that fruit1 doesn't have but emerges in fruit2, fruit3, and fruit4. There is no need to compare between fruit2 and fruit3 and etc, only compared with fruit1. Also, the comparison is case sensitive, which means Banana is different from banana.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Want:&lt;/P&gt;
&lt;TABLE width="396"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="132"&gt;differences in fruit2&lt;/TD&gt;
&lt;TD width="132"&gt;differences in fruit3&lt;/TD&gt;
&lt;TD width="132"&gt;differences in fruit4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;blueberry&lt;/TD&gt;
&lt;TD&gt;pears&lt;/TD&gt;
&lt;TD&gt;apples&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;strawberry&lt;/TD&gt;
&lt;TD&gt;blueberry&lt;/TD&gt;
&lt;TD&gt;pears&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;strawberry&lt;/TD&gt;
&lt;TD&gt;Banana&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;date&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance for any help!!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 21:10:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623170#M183404</guid>
      <dc:creator>CynthiaWei</dc:creator>
      <dc:date>2020-02-07T21:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to print out the differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623172#M183405</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
infile cards truncover;
input (Fruit1	Fruit2	Fruit3	Fruit4) (:$20.);
cards;
apple	pear	apple	apples
pear	blueberry	pears	pears
banana	strawberry	avocado	Banana
avocado	grape	blueberry	avocado
grape	apple	strawberry	 
 .	. 	grape	. . 
 .	 .	date	 . .
	 ;


data want;
 if _n_=1 then do;
   dcl hash H (dataset:'have') ;
   h.definekey  ("fruit1") ;
   h.definedone () ;
 end;
  set have;
 array ff fruit2-fruit4;
 array f $20 fruit_diff2-fruit_diff4;
 do over f;
  if h.check(key:ff) ne 0 then f=ff;
 end;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 21:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623172#M183405</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2020-02-07T21:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to print out the differences</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623284#M183469</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you so much for the code. It works great!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;C&lt;/P&gt;</description>
      <pubDate>Sat, 08 Feb 2020 08:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-out-the-differences/m-p/623284#M183469</guid>
      <dc:creator>CynthiaWei</dc:creator>
      <dc:date>2020-02-08T08:48:36Z</dc:date>
    </item>
  </channel>
</rss>

