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.

13 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!

  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;

  4. Razoo says:

    Dear Chen,

    Thank you very much for the code.

    Could you please post a code for linking between compustat and audit analytics without CRSP and I/B/E/S?

    Thank you very much again,

  5. Hui Tian says:

    Dear Kai,
    Many thanks for the codes and they really help a lot!
    Can I ask a dumb question about how to find “the linking header table between GVKEY and IBES ticker (IBTIC) in its SECURITY table (located in /wrds/comp/sasdata/na/security/)”.
    Is this Security table still available on WRDS? I could not find this table in my WRDS account. Do you have an Internet link for this table?
    Thank you very much!!

    • Benny Wang says:

      I use FileZilla to download data, and now you can find SECURITY table under this route: /wrdslin/comp/sasdata/naa/security/security.sas7bdat

Leave a Reply

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