Hi all, I'm replicating the work of a paper published in the AER (link here: https://www.aeaweb.org/articles?id=10.1257/aer.96.3.796) It seems like the authors use SAS to download data from WRDS/Compustat. I'm trying to do something similar but my problem is that I can't refer to the data items in compustat. I had to manually download a small sub-sample of the dataset and figure out the naming. It seems that refering to variable names using Dataxxx is standard in compustat. libname dat '/crds/compustat/sasdata';
*this is a dataset downloaded from WRDS and the authors are referencing to the library;
data a;
set dat.fcab2;
fileid=1;
array data data1-data350;
do over data;
if abs(data-.0001) le .00001
then data=.;
else if abs(data-.0008) le .00001
then data=0;
end;
year=year(date);
year=year-1900;
keep cnum cic dnum year fyr fileid smbl
data1 data2
data147 data148
aftnt1 aftnt13 aftnt15 aftnt22 aftnt25 aftnt28 aftnt29
aftnt32 aftnt33 aftnt34 aftnt35 aftnt37 aftnt39 aftnt50
cpspin csspii csspin data308 finc xrel naics spdrc; The code that I'm working on is attached. It should be an easy question for someone who already uses this method to access Compustat data. Thank you very much!!
... View more