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 uses the macro ICLINK. In order to use this macro, you need to add the following line to your file in your WRDS home directory (see here for details):

options sasautos=('/wrds/wrdsmacros/', SASAUTOS) MAUTOSOURCE;


This entry was posted in SAS. Bookmark the permalink.

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

  1. CC says:

    Hi Kai,
    Your posts are super helpful and I really enjoyed reading them.
    For this post, I have got one question:
    Could we access the file in home directory via PC SAS Connect? Or has to use SSH to access and change file?


    • Kai Chen says:

      We have to use SSH to access the file. I usually use Cyberduck, a FTP-like app on my Mac to access and edit this file. If you are familiar with Linux-like command line, you can simply access and edit this file via Terminal (or anything equivalent on PC). Also ensure you are SSHing the right server ( since WRDS is transitioning to its new Cloud server recently.

  2. June says:

    Hi Kai,
    Thank you for your material. It helps me a lot!
    I am wondering how to identify the year the restated financial statements were originally issued?
    Thank you in advance!

    • Kai Chen says:

      By definition, this may be not a one-to-one match. A restatement disclosure may affect financial statements in several prior years. For example, when a sales recognition error is identified in a restatement disclosure, the sales in several prior years may be required to restate. AA collects restatement disclosure. Each restatement disclosure may restate multiple financial statements. I do not have a good idea now and sorry I cannot give you a more positive reply.

  3. Eva says:

    Hi Kai,

    Correct me if I am wrong. The following code will delete the duplicate observations. But why you only keep the first.permno? Shouldn’t we keep the ones with highest scores? Further, when two duplicate observations have the same score, why we should keep the first.permno?


    data ibeslink; set ibeslink;
    by permno ticker; if first.permno;

Leave a Reply

Your email address will not be published. Required fields are marked *