Data before 1998 available in Compustat naa/funda
Posted: 16 July 2015 11:40 PM   [ Ignore ]
Newbie
Rank
Total Posts:  6
Joined  2015-07-01

Hi,

I am running the following code:

proc printto;
run;

Define libraries for each databaseCCMCRSP monthly dataCompustat North America;
CRSP Link to be checked;
libname crsp '/wrds/crsp/sasdata/a_ccm';
libname crsp2 '/wrds/crsp/sasdata/a_stock';
libname comp '/wrds/comp/sasdata/naa';

/*************************************************************
* STEP ONE: Extract Compustat data;
****************************************************************/
Selected GVKEYS-- use quotes to be consistent with character variables;
*%
let glist '006066' '012141' '014489';
%
let glist '';

Date range-- applied to FYEAR (Fiscal Year);
%
let fyear11998;
%
let fyear22012;

Selected data items (GVKEYDATADATEFYEAR and FYR are automatialy included);
%
let varsgvkey fyr fyear datadate INDFMT DATAFMT POPSRC CONSOL AT LT CEQ SALE EBITDA SICH ACT CH LCT DLC TXP DP DLTT MIB PSTK CEQ CHE REVT COGS IB PPEGT INVT SEQ TXDB ITCB XPR CSHO ADJEX_C mkvalt prcl_f WCAP NI FFO UTFDOC;
%
let vars_CRSP_monthlydate ret cusip prc shrout;

*** 
Filters:
aStock Price > $5 over the last 12 months;
%
let min_price 5;

bMinimum total assets;
%
let min_total_assets 0;

cMinimum market cap;
%
let min_mkt_cap 0;

dIndustry FilterRemove Utilities Financials (but keep Insurance7000-7369);
%
let utilities_SICH_low 5000;
%
let utilities_SICH_high 5999;

%
let financials_SICH_low 6500;
%
let financials_SICH_high 6999;

***

Make extract from Compustat Annual Funda file;
data compx2;
set comp.funda (keep= &vars;);
where /* gvkey in (&glist;) and */ fyear between &fyear1; and &fyear2; and AT >= &min;_total_assets and mkvalt >= &min;_mkt_cap and prcl_f >= &min;_price and SICH NOT between &utilities;_SICH_low and &utilities;_SICH_high and SICH NOT between &financials;_SICH_low and &financials;_SICH_high;
if 
indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';

create begin and end dates for fiscal year;
format endfyr begfyr date9.;
endfyrdatadate;
begfyrintnx('month',endfyr,-11,'beg'); /* intnx(interval, from, n, 'aligment') */
sxasale/at; * compute sales over assets ratio;
/* keep gvkey begfyr endfyr sxa fyr fyear;* keep only relevant variables; */
run;

proc sort
by  endfyr gvkey;
run;


proc print data=&syslast;(obs=100);
by gvkey;
id fyear;
var 
fyear begfyr endfyr sxa;
run

I would like to get Compustat data starting in 1981 but for some reason the oldest date I get is 1998. Does anyone knows why? Is there a trick to access data before that? Please help!

 

Profile
 
 
Posted: 23 July 2015 04:50 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  901
Joined  2011-09-19

hi,

It looks like that the variable mkvalt is only populated starting in 1998. Before that, it is set to missing, so earlier years do not satisfy the filter (mkvalt > 0).

Best regards,

Joost

 Signature 

To reply/post new questions: Please use the group WRDS/SAS on Google Groups! http://groups.google.com/d/forum/wrdssas

Profile