<?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: Merging Compustat and CRSP( my CRSP date changed..) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572272#M161492</link>
    <description>I would recommend posting the solution and then marking it as the answer?</description>
    <pubDate>Wed, 10 Jul 2019 01:28:24 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-07-10T01:28:24Z</dc:date>
    <item>
      <title>Merging Compustat and CRSP( my CRSP date changed..)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572263#M161488</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CRSP_new;
set CRSP1;
year = YEAR(date);
run;

proc sql;
create table crspcomp as
select a.* , b.*
from cstatcusip1 a
inner join CRSP_new b
on a.cusip8 = b.cusip and a.fyear= b.year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used this code. It worked well! awesome!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well... now I noticed that the Date on original CRSP file changed to the same dates of Compustat file(To be more specific, they become like certain-patterned numbers. and I changed these by resetting formats to YYMMDDN8.) Since Compustat dates are mostly year-end, I have many duplicated 12/31 days. For example 2011/10/13 -&amp;gt; 2011/12/31.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks that because of this code;&amp;nbsp;&lt;CODE class=" language-sas"&gt;year = YEAR(date);&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;I thought the year converted only used for matching and original CRSP dates should remain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I saw a warning sign when clicking 'submit' that there is already 'date' variables in&amp;nbsp;&lt;CODE class=" language-sas"&gt;crspcomp(newly created one by merge)&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;I thought that is as there is only one 'date' variable in two sets so there will be only one 'date' variable after merge too. I already check my Compustat file where the name of the date variable is 'datadate'&amp;nbsp; so no two 'date' variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please share your ideas and wisdom how I keep CRSP date after merging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I truly sincerely appreciate all help from all of you!!!&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 23:12:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572263#M161488</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-09T23:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Compustat and CRSP( my CRSP date changed..)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572264#M161489</link>
      <description>Oh... I cannot remove this post. NEVER MIND. I found what was an issue. Sorry all of you</description>
      <pubDate>Tue, 09 Jul 2019 23:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572264#M161489</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-09T23:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Compustat and CRSP( my CRSP date changed..)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572272#M161492</link>
      <description>I would recommend posting the solution and then marking it as the answer?</description>
      <pubDate>Wed, 10 Jul 2019 01:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572272#M161492</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-07-10T01:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Compustat and CRSP( my CRSP date changed..)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572443#M161539</link>
      <description>Agree and I did!</description>
      <pubDate>Wed, 10 Jul 2019 17:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572443#M161539</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-10T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Compustat and CRSP( my CRSP date changed..)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572444#M161540</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code itself is fine!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUT REMEMBER there is no same variable NAME in your files. That was my silly mistakes!&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2019 17:37:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Compustat-and-CRSP-my-CRSP-date-changed/m-p/572444#M161540</guid>
      <dc:creator>JKCho</dc:creator>
      <dc:date>2019-07-10T17:37:40Z</dc:date>
    </item>
  </channel>
</rss>

