<?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: compare two dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650560#M195084</link>
    <description>&lt;P&gt;and after 30/04/2002 comes from B and create variable C. sorry it didn't allow me to finish whole question in one&lt;/P&gt;</description>
    <pubDate>Tue, 26 May 2020 00:04:12 GMT</pubDate>
    <dc:creator>SASUser0001</dc:creator>
    <dc:date>2020-05-26T00:04:12Z</dc:date>
    <item>
      <title>compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650551#M195080</link>
      <description>&lt;P&gt;hi I have two variables A and B . I wanted to compare those two variables based on date variable. on a particular date like 02/02/2019 if data is same then copy data before 02/0/2/2019 from A and 02/02/2/019 onwards&amp;nbsp; data from B and create new variable.&lt;/P&gt;&lt;P&gt;I am trying something like this.&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set test_1;&lt;/P&gt;&lt;P&gt;length new_variable 8.;&lt;/P&gt;&lt;P&gt;if date='02FEB2019' then do;&lt;/P&gt;&lt;P&gt;if&amp;nbsp; A=B then new_variable&amp;nbsp;= A;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 25 May 2020 23:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650551#M195080</guid>
      <dc:creator>SASUser0001</dc:creator>
      <dc:date>2020-05-25T23:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650553#M195082</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date='02FEB2019'D then do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;IIf that doesn' t fix the problem, then please explain the problem in a lot more detail, and please show us a portion of your data set. &lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 May 2020 23:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650553#M195082</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-25T23:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650559#M195083</link>
      <description>&lt;P&gt;&lt;STRONG&gt;it bring data for that date but I wanted to bring all the data from this date. but it gives me only for that particular day record like one record.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;29&lt;/P&gt;&lt;P&gt;30 data test&lt;/P&gt;&lt;P&gt;31 set test_1&lt;/P&gt;&lt;P&gt;32 length&amp;nbsp;C 8.&lt;/P&gt;&lt;P&gt;33&lt;/P&gt;&lt;P&gt;34 if date='31APR2002'd then do&lt;/P&gt;&lt;P&gt;35 if&amp;nbsp;A =B then C=A&lt;/P&gt;&lt;P&gt;36 end&lt;/P&gt;&lt;P&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so like following if A and b have same data on 30/04/2002 then before 30/04/2002 data comes from A and after 30/&lt;/P&gt;&lt;P&gt;date&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; A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; B&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;28&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Feb-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1236&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;5842&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;31&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Mar-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;5662&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;553&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Apr-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3526&lt;/FONT&gt;&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3526&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Jun-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3525&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;2060&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Sep-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3524&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;2041&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;31&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Dec-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;02&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3523&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;2022&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;31&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Mar-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3522&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;2003&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Jun-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3521&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1984&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;30&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Sep-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3520&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1965&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;&lt;STRONG&gt;31&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;-Dec-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;03&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;3519&lt;/FONT&gt;&lt;/STRONG&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#008080"&gt;1946&lt;/FONT&gt;&lt;/STRONG&gt;&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, 26 May 2020 00:02:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650559#M195083</guid>
      <dc:creator>SASUser0001</dc:creator>
      <dc:date>2020-05-26T00:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650560#M195084</link>
      <description>&lt;P&gt;and after 30/04/2002 comes from B and create variable C. sorry it didn't allow me to finish whole question in one&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 00:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650560#M195084</guid>
      <dc:creator>SASUser0001</dc:creator>
      <dc:date>2020-05-26T00:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650561#M195085</link>
      <description>&lt;P&gt;Please do NOT post code or log without semicolons. We have &lt;A href="https://communities.sas.com/t5/SAS-Programming/proc-summary/m-p/648258#M194153" target="_self"&gt;previously requested&lt;/A&gt; you not do this. Use the &amp;lt;/&amp;gt; icon to post your log and use the "running man" icon to post code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your example, what should be done if A is not equal to B on the given date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 May 2020 00:36:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650561#M195085</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-05-26T00:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650563#M195086</link>
      <description>&lt;P&gt;sorry I didn't add semicolons as it gives me error when write message here.&amp;nbsp; if A=B then variable C should be created else c will be null. the way C should be created is before 30April2002 should come from A and after 30April2002 from B. thanks For helping&lt;/P&gt;</description>
      <pubDate>Tue, 26 May 2020 00:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650563#M195086</guid>
      <dc:creator>SASUser0001</dc:creator>
      <dc:date>2020-05-26T00:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: compare two dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650602#M195103</link>
      <description>&lt;P&gt;I think what you want to do is something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  set test_1;
  retain switch 0;
  if date='02FEB2019' and A=B then 
    switch=1;
  if switch then
    C=B;
  else
    C=A;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 May 2020 06:22:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/compare-two-dataset/m-p/650602#M195103</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-05-26T06:22:41Z</dc:date>
    </item>
  </channel>
</rss>

