<?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: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file. in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/417307#M12741</link>
    <description>&lt;P&gt;How can you get GVKEY in CRSP ?&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 05:34:18 GMT</pubDate>
    <dc:creator>Kyojik</dc:creator>
    <dc:date>2017-11-30T05:34:18Z</dc:date>
    <item>
      <title>Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294686#M8325</link>
      <description>&lt;P&gt;I am having a problem in merging two datasets--COMPUSTAT annual and CRSP Monthly Stock file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;COMPUSTAT DATA:&lt;/P&gt;&lt;P&gt;gvkey&amp;nbsp; &amp;nbsp;datadate&amp;nbsp; &amp;nbsp; &amp;nbsp; yr &amp;nbsp; &amp;nbsp;indfmt&amp;nbsp;&amp;nbsp;consol&amp;nbsp; &amp;nbsp;popsrc&amp;nbsp; &amp;nbsp;datafmt&amp;nbsp;&amp;nbsp;tic&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;cusip&lt;BR /&gt;001000 31dec1974 1974 INDL &amp;nbsp;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; STD &amp;nbsp; &amp;nbsp; &amp;nbsp; AE.2 &amp;nbsp;000032102&lt;BR /&gt;001004 31may1975 1974 INDL C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STD &amp;nbsp; &amp;nbsp; &amp;nbsp; AIR &amp;nbsp; &amp;nbsp;000361105&lt;BR /&gt;001005 31oct1974 1974 INDL &amp;nbsp; C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STD &amp;nbsp; &amp;nbsp; &amp;nbsp; ABA.2 000370106&lt;BR /&gt;001006 30jun1974 1974 INDL C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STD &amp;nbsp; &amp;nbsp; &amp;nbsp; 1145B 000736108&lt;BR /&gt;001007 30sep1974 1974 INDL C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;STD &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4135B 000774109&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CRSP DATA:&lt;/P&gt;&lt;P&gt;gvkey &amp;nbsp; linkprim linktype lpermno lpermco iid datadate tic cusip&lt;BR /&gt;001000 P LU 25881 23369 01 31mar1974 AE.2 000032102&lt;BR /&gt;001000 P LU 25881 23369 01 28feb1974 AE.2 000032102&lt;BR /&gt;001000 P LU 25881 23369 01 31jan1974 AE.2 000032102&lt;BR /&gt;001004 P LU 54594 20000 01 31mar1974 AIR 000361105&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the CRSP datasets is monthly whereas COMPUSTAT is annual. CRSP also has a YEAR variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your step by step reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 03:06:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294686#M8325</guid>
      <dc:creator>nzrdufiu</dc:creator>
      <dc:date>2016-08-29T03:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294689#M8326</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CRSP_new;
set CRSP;
yr = YEAR(date);
run;

proc sql;
create table Mereged_table as
select a.* , b.*
from COMPUSTAT a
inner join CRSP_new b
on a.gvkey = b.gvkey and a.yr= b.yr;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope I got your problem right.&lt;/P&gt;&lt;P&gt;Step1. in CRSP dataset, create new variable yr that would hold value of year.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Step2. Merge COMPUSTAT and CRSP_new on two columns gvkey and yr.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above code it is not tested.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 03:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294689#M8326</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-08-29T03:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294690#M8327</link>
      <description>&lt;P&gt;It would be great if you list what should your output look like.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 03:57:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294690#M8327</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-08-29T03:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294701#M8328</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1751"&gt;@RahulG&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data CRSP_new;
set CRSP;
yr = YEAR(date);
run;

proc sql;
create table Mereged_table as
select a.* , b.*
from COMPUSTAT a
inner join CRSP_new b
on a.gvkey = b.gvkey and a.yr= b.yr;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope I got your problem right.&lt;/P&gt;
&lt;P&gt;Step1. in CRSP dataset, create new variable yr that would hold value of year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Step2. Merge COMPUSTAT and CRSP_new on two columns gvkey and yr.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Above code it is not tested.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/1751"&gt;@RahulG&lt;/a&gt;&amp;nbsp;In this case it might be easier to do the calculation in the join condition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;a.yr=year(b.date)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2016 06:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/294701#M8328</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-29T06:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/296429#M8357</link>
      <description>&lt;P&gt;Thank you. It worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 01:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/296429#M8357</guid>
      <dc:creator>nzrdufiu</dc:creator>
      <dc:date>2016-09-05T01:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/296430#M8358</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Sep 2016 01:28:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/296430#M8358</guid>
      <dc:creator>nzrdufiu</dc:creator>
      <dc:date>2016-09-05T01:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/417307#M12741</link>
      <description>&lt;P&gt;How can you get GVKEY in CRSP ?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 05:34:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/417307#M12741</guid>
      <dc:creator>Kyojik</dc:creator>
      <dc:date>2017-11-30T05:34:18Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502905#M15608</link>
      <description>Hi, I am new on the forum but I am doing my MBA thesis on executive compensation and need to download data from ExecuComp. Can anyone help with acess to this database?</description>
      <pubDate>Tue, 09 Oct 2018 20:50:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502905#M15608</guid>
      <dc:creator>Darrel</dc:creator>
      <dc:date>2018-10-09T20:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502906#M15609</link>
      <description>&lt;P&gt;I believe these data are here, but you need to have access via your institution as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://wrds-web.wharton.upenn.edu/wrds/" target="_blank"&gt;https://wrds-web.wharton.upenn.edu/wrds/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 20:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502906#M15609</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-09T20:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502908#M15610</link>
      <description>Thank you for your reply. However this is exactly my problem my university does not have a WRDS account</description>
      <pubDate>Tue, 09 Oct 2018 20:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502908#M15610</guid>
      <dc:creator>Darrel</dc:creator>
      <dc:date>2018-10-09T20:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502910#M15611</link>
      <description>Is there a way someone can help me get access?</description>
      <pubDate>Tue, 09 Oct 2018 21:05:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502910#M15611</guid>
      <dc:creator>Darrel</dc:creator>
      <dc:date>2018-10-09T21:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502912#M15612</link>
      <description>&lt;P&gt;They have a trial access, did you try that approach? Not sure if that would let you take data out. And how can you site the source if you don't have access?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think this is a problem you should discuss with your thesis supervisor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/239355"&gt;@Darrel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Is there a way someone can help me get access?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Oct 2018 21:12:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502912#M15612</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-10-09T21:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Most effective way to merge COMPUSTAT annual and CRSP monthly stock return file.</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502983#M15613</link>
      <description>&lt;P&gt;It is not allowed to distribute these databases. It will be a problem for Author if he/she is using some data which is not subscribed by their institutions. The most likely way is to collaborate (joint research) with someone from the institution who has access.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 05:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Most-effective-way-to-merge-COMPUSTAT-annual-and-CRSP-monthly/m-p/502983#M15613</guid>
      <dc:creator>Kyojik</dc:creator>
      <dc:date>2018-10-10T05:34:38Z</dc:date>
    </item>
  </channel>
</rss>

