<?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: need third variable bases on data in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/need-third-variable-bases-on-data/m-p/843109#M36555</link>
    <description>&lt;P&gt;Have you got instructions how to create the output? what are the rules ?&lt;/P&gt;
&lt;P&gt;I suppose that if data on both datasets is the same then remark="OK";&lt;/P&gt;
&lt;P&gt;else remark="NOTOK";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To achieve that use merge statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=_name);
  merge have(in=in1) 
        have2(in=in2 rename=(name=_name));
  by ID;
      if in1 and in2 and name=_name then remark='ok';
      else if in1 and in2 then remark = 'notok';
      else delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 13:32:26 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2022-11-08T13:32:26Z</dc:date>
    <item>
      <title>need third variable bases on data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/need-third-variable-bases-on-data/m-p/843053#M36551</link>
      <description>&lt;P&gt;data have;&lt;/P&gt;
&lt;P&gt;input id name;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;1 rahul&lt;/P&gt;
&lt;P&gt;2 rohit&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 nisha&lt;/P&gt;
&lt;P&gt;9 kuldeep&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;data have2;&lt;/P&gt;
&lt;P&gt;input id name;&lt;/P&gt;
&lt;P&gt;datalines;&lt;/P&gt;
&lt;P&gt;1 rahul&lt;/P&gt;
&lt;P&gt;2 rohit&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3 nisha&lt;/P&gt;
&lt;P&gt;4 pukit&lt;/P&gt;
&lt;P&gt;5 aakash&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;final output should look like&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id name&amp;nbsp; &amp;nbsp; remark&lt;/P&gt;
&lt;P&gt;1 rahul&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ok&lt;/P&gt;
&lt;P&gt;2 rohit&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ok&lt;/P&gt;
&lt;P&gt;3 nisha&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ok&lt;/P&gt;
&lt;P&gt;9 kuldeep&amp;nbsp; &amp;nbsp; notok&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;
&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>Tue, 08 Nov 2022 08:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/need-third-variable-bases-on-data/m-p/843053#M36551</guid>
      <dc:creator>aanan1417</dc:creator>
      <dc:date>2022-11-08T08:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: need third variable bases on data</title>
      <link>https://communities.sas.com/t5/New-SAS-User/need-third-variable-bases-on-data/m-p/843109#M36555</link>
      <description>&lt;P&gt;Have you got instructions how to create the output? what are the rules ?&lt;/P&gt;
&lt;P&gt;I suppose that if data on both datasets is the same then remark="OK";&lt;/P&gt;
&lt;P&gt;else remark="NOTOK";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To achieve that use merge statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want(drop=_name);
  merge have(in=in1) 
        have2(in=in2 rename=(name=_name));
  by ID;
      if in1 and in2 and name=_name then remark='ok';
      else if in1 and in2 then remark = 'notok';
      else delete;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 13:32:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/need-third-variable-bases-on-data/m-p/843109#M36555</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2022-11-08T13:32:26Z</dc:date>
    </item>
  </channel>
</rss>

