SAS program that creates a file that links CRSP Permno and Compustat GVKEY following method described in Beaver, McNichols, and Price (2007)
The _mycstlink.sas macro includes extensive comments.
The _mycstlink_example.sas program illustrates how to use the macro and how to merge Compustat and CRSP using the macro
Note: older legacy versions are also posted for old versions of the Compustat database