<?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: comparing the tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515794#M139238</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;



data table1;
input sequence_number 	findings $;
cards;
1	yes 
2	yes 
3	No 
4	No 
5	yes 
6	No 
;

data table2;
input  sequence_number 	findings $;
cards;
1	no 
2	no 
3	yes 
4	yes 
5	yes 
6	No 
;

data want;

merge table1 table2(rename=(findings=f));

if findings='No' and f='yes' then findings='yes';

drop f;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge table1 table2(rename=(findings=f));&lt;/P&gt;
&lt;P&gt;if findings='No' and f='yes' then findings='yes';&lt;/P&gt;
&lt;P&gt;drop f;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE; Your sequence 6 has NO in both tables, so that can't be YES in output&lt;/P&gt;</description>
    <pubDate>Sun, 25 Nov 2018 22:23:14 GMT</pubDate>
    <dc:creator>novinosrin</dc:creator>
    <dc:date>2018-11-25T22:23:14Z</dc:date>
    <item>
      <title>comparing the tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515790#M139237</link>
      <description>&lt;P&gt;Hi i have two tables with same variable name which contains yes or no as values and sequence number&amp;nbsp; i want to create a new variable by comparing that value in both the tables like if the first table has no as an answer then i want to get yes from table 2.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;table 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbs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gt;</description>
      <pubDate>Mon, 26 Nov 2018 07:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515790#M139237</guid>
      <dc:creator>Aayushi_17</dc:creator>
      <dc:date>2018-11-26T07:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: comparing the tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515794#M139238</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;



data table1;
input sequence_number 	findings $;
cards;
1	yes 
2	yes 
3	No 
4	No 
5	yes 
6	No 
;

data table2;
input  sequence_number 	findings $;
cards;
1	no 
2	no 
3	yes 
4	yes 
5	yes 
6	No 
;

data want;

merge table1 table2(rename=(findings=f));

if findings='No' and f='yes' then findings='yes';

drop f;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;merge table1 table2(rename=(findings=f));&lt;/P&gt;
&lt;P&gt;if findings='No' and f='yes' then findings='yes';&lt;/P&gt;
&lt;P&gt;drop f;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE; Your sequence 6 has NO in both tables, so that can't be YES in output&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 22:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515794#M139238</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-25T22:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: comparing the tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515796#M139239</link>
      <description>&lt;P&gt;thank you so much&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 17:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515796#M139239</guid>
      <dc:creator>Aayushi_17</dc:creator>
      <dc:date>2018-11-25T17:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: comparing the tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515801#M139241</link>
      <description>&lt;P&gt;what sets&amp;nbsp;&lt;SPAN&gt;sequence number&lt;/SPAN&gt; 6 to yes since both incoming tables has&amp;nbsp;&lt;SPAN&gt;sequence number&lt;/SPAN&gt; 6 as No?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Nov 2018 17:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515801#M139241</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-11-25T17:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: comparing the tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515902#M139284</link>
      <description>sorry that table 1 should contain no and table 2 should contain yes</description>
      <pubDate>Mon, 26 Nov 2018 06:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/comparing-the-tables/m-p/515902#M139284</guid>
      <dc:creator>Aayushi_17</dc:creator>
      <dc:date>2018-11-26T06:59:50Z</dc:date>
    </item>
  </channel>
</rss>

