Category Archives: SAS

Download FR Y-9C data from WRDS

WRDS currently populates FR Y-9C data quarter by quarter in individual datasets, like BHCF200803, BHCF200806, BHCF200809 and so on. WRDS has not stacked those individual datasets to formulate a single time-series dataset like COMPUSTAT. There are two ways to overcome … Continue reading

Posted in Data, SAS | Leave a comment

The impact of WRDS transition to the new WRDS Cloud server

WRDS has quietly started the transition from the old server to the new Cloud server. This move makes a lot of support documentation on the WRDS website outdated and misleading. That is why I think WRDS should direct its resources on continuously … Continue reading

Posted in Learning Resources, SAS | 1 Comment

Rolling-window computation in SAS and Stata

SASers often find proc expand plus transformout very useful for rolling-window (or moving-window) computation. Stataers may wonder if there is a counter party in Stata. The answer is “yes”. The command in Stata is rolling. See the manual below: http://www.stata.com/manuals13/tsrolling.pdf The … Continue reading

Posted in Learning Resources, SAS, Stata | Leave a comment

SAS macro for event study and beta

There are two macros on the List of WRDS Research Macros: EVTSTUDY and BETA, which may be often used. I like the first one, written by Denys Glushkov. Denys’ codes are always elegant. I don’t like the second one because … Continue reading

Posted in SAS | 1 Comment

If beginning year and ending year are known, how to fill in years in between?

Question: Suppose two companies A and B are connected in some years. Say, right now the data structure is the following: Company 1 Company 2 Starting Year Ending Year A B 2000 2006 A C 1998 2003 C D 1995 … Continue reading

Posted in SAS | Leave a comment

SAS macro to get analysts EPS consensus for a given fiscal period end (DATADATE) by a selected date (DATE)

I write this macro to compute analysts’ quarterly EPS consensus on a selected date (DATE) for a given fiscal quarter end (DATADATE). This macro can be easily modified for other types of estimates (e.g., annual EPS). This macro currently extracts unadjusted quarterly EPS estimates (current … Continue reading

Posted in SAS | Comments Off on SAS macro to get analysts EPS consensus for a given fiscal period end (DATADATE) by a selected date (DATE)

Link Audit Analytics, Compustat, CRSP and I/B/E/S

The following program is used to link each financial restatement in Audit Analytics to Compustat, CRSP, and I/B/E/S. The resultant dataset aa contains unique identifiers of Audit Analytics (res_notify_key), Compustat (gvkey), CRSP (permno), and I/B/E/S (ibtic). Please note this program … Continue reading

Posted in SAS | 9 Comments

Calculate delta (pay-performance sensitivity), vega (risktaking incentives), and firm-specific wealth (inside equity) for executives on Execucomp

Several papers use measures of delta (pay-performance sensitivity), vega (risktaking incentives), and firm-specific wealth (inside equity) for executives on Execucomp. For example, 1.  Core, J., Guay, W., 2002. Estimate the value of employee stock option portfolios and their sensitivities to price … Continue reading

Posted in SAS | 7 Comments

Look into CRSP/COMPUSTAT link table

The link history table (CCMXPF_LNKHIST) is the main table is used for WRDS CCM web queries. So I focus on this link table. BACKGROUND We know that a company can issue multiple securities, of which one is considered primary for … Continue reading

Posted in Learning Resources, SAS | 6 Comments

SAS and Stata—Which is better for archival accounting research?

The short answer is: we need both. When we do archival accounting research, we often need to merge data across various databases, such as COMPUSTAT, CRSP, and EXECUCOMP. Stata can by no means beat SAS in this regard. SAS supports … Continue reading

Posted in Learning Resources, SAS, Stata | 1 Comment