Hi all,
I want to construct a data set using firm-level balance sheet data from Compustat. The dataset should be at the quarterly frequency. However, some variables I need (such as the number of employees) are only available in the Fundamentals annual database, which is why I want to merge data from Compustat Fundamentals Quarterly with data from Compustat Fundamentals Annual. In principle, such a merge should be straightforward as the two databases feature the same identifier and time variable.
Here is what I did: I downloaded the data using SAS Studio. To produce one record per gvkey-datadate pair, I screen on indfmt = 'INDL', datafmt ='STD', popsrc='D', and consol='C'. Furthermore, I take the fiscal view (i.e. I drop observations where 'datafqtr' is missing) when downloading the quarterly data. Strangely, this does not produce unique gvkey-datadate pairs in case of the quarterly data: I get a number of duplicates. This is confusing as on the WRDS query page, it is stated that these screening values should produce one record per gvkey-datadate pair. Only when I drop observations for which 'datacqtr' is missing as well, I am able to get a dataset free of duplicates in terms of gvkey-datadate. In a next step, I merge the quarterly data with the annual data using an 1:1 merge on gvkey and datadate.
Does this sound like the correct way of merging Fundamentals Annual and Quarterly data from Compustat or is there a better way to merge the two? Why is screening on 'datafqtr' not sufficient (fiscal view) and what is the interpretation of screening over both 'datafqtr' and datacqtr'?
Many thanks for your help!
Best,
Diego