Look into CRSP/Compustat link table

The link history table (CCMXPF_LNKHIST) is the primary table used for WRDS CCM web queries. In this post, I explain this table in detail.

Background

We know that a company may issue multiple securities, one of which is considered primary for the company. On CRSP, this suggests that one PERMCO (the company-lever identifier) may have multiple PERMNOs (the security-level identifier). Because CRSP collects security-level data such as price and trading volume, we should consider CRSP as breaking down to the security level.

It is well known that Compustat provides financial statement data of a company. The micro unit on Compustat is each and every company. However, it is less known that Compustat also provides security data. In addition, because the coverage of Compustat is more extensive than that of CRSP, Compustat contains addtional security data that are unavailable on CRSP.

Historically, Compustat included only one (primary) security per company. Since mid-April in 2007, all securities issued by a company are available on Compustat with a new identifier, IID, which is used along with GVKEY to identify all securities tracked by Compustat. A marker item, PRIMISS, indicates whether a security is primary or secondary. Therefore, like PERMCO on CRSP, one GVKEY may have multiple IIDs currently.

Let me summarize the identifiers used by Compustat and CRSP:

Database

Identifier

Description

Compustat

GVKEY

Compustat’s permanent company identifier.

Compustat

IID

Compustat’s permanent security identifier. An identifying relationship exists between IID and GVKEY. Both must be accessed as a pair to properly identify a Compustat security. One GVKEY may have multiple IIDs.

Compustat

PRIMISS

This item indicates whether a security is primary (P) or secondary (J). P identifies a primary security with the highest average trading volume over a period of time. J identifies a joiner (secondary) security.

CRSP

PERMCO

CRSP’s permanent company identifier.

CRSP

PERMNO

CRSP’s permanent security identifier. One PERMNO belongs to only one PERMCO. One PERMCO may have one or more PERMNOs.

The last piece of background information is that the link between CRSP and Compustat (at both company level and security level) may change over time.

The linking process

Prior to the introduction of IID, Compustat included only one (primary) security per company. The link between CRSP and Compustat was between CRSP PERMNO and Compustat GVKEY. Because PERMNO is a security identifier and GVKEY is a company identifier, this link may be a many-to-one relationship, i.e., multiple PERMNOs may be linked to a single GVKEY.

Because Compustat security-level information is now available, CRSP started to build security-level links in April 2007.

The linking history table

The main product of CRSP’s laborious linking efforts is the link history table. This table is Compustat-centric, that is, this table is organized and identified by Compustat identifiers which are then linked to CRSP identifiers. All Compustat records are retained, regardless of whether or not the securities (defined by GVKEY-IID) are in the CRSP universe.The following is a slice of the table (Please note that IID, PERMCO, and PERMNO have the prefix “L” in the link history table.):

GVKEY

LINKPRIM

LIID

LINKTYPE

LPERMNO

LPERMCO

LINKDT

LINKENDDT

COMPUSTAT global company key

Primary link marker

Security-level identifier

Link type code

Historical CRSP PERMNO link to COMPUSTAT record

Historical CRSP PERMCO link to COMPUSTAT record

First effective date of link

Last effective date of link

10411

P

1

LC

63773

5230

19811215

.E

10411

P

1

NR

19741129

19811214

10411

J

7

LC

90655

5230

20050516

20120131

10411

J

6

NR

20050429

20060131

10411

J

2

NR

19940331

.E

10411

J

4

NR

20020131

20060131

LIID is based on Compustat’s IID. Because Compustat’s company data range extends earlier than its security data range, there are time periods during which no IID is assigned by Compustat for a GVKEY. In these cases, CRSP assigns a dummy IID ending in “X” as a placeholder in the link table. This GVKEY-dummy IID may or may not be linked to a CRSP PERMNO.

LINKPRIM is a marker item that indicates whether a GVKEY-LIID is a primary security. This marker is based on Compustat’s Primary/Joiner flag (PRIMISS). However, due to missing primary issue markers from Compustat for early history, calendar ranges of overlapping, and different treatment for US and Canadian security issues, CRSP overides Compustat’s primary issue marker in many cases. The purpose is to produce one primary security throughout the company history. “P” represents the primary security issue identified by Compustat, while “C” represents the primary security issue identified or overridden by CRSP. In most applications, we only need the primary security.

Another important item is LINKTYPE. In short, LC and LU are considered as the most accurate links. They are also the default link types used for WRDS CCM web queries. LX and LD are considered as “soft” links of low accuracy. Old merging sample codes also include LS in addition to LC and LU. But by definition below, I do not think that LS should be included.

LINKDT and LINKENDDT are straightforward. They mark the period during which the link is valid.

Please see the detailed description of each item:

ITEM NAME

TYPE

DESCRIPTION

GVKEY

integer, primary key (1)

Compustat GVKEY

LIID

char(3), primary key (2)

Compustat IID. A dummy IID with an “X” suffix is assigned by CRSP as a placeholder if no IID is assigned by Compustat for a GVKEY in early history.

LINKDT

integer (date), primary key (3)

First effective calendar date of link record range

LINKENDDT

integer (date)

Last effective calendar date of link record range

LPERMNO

integer

Linked CRSP PERMNO, 0 if no CRSP security link exists

LPERMCO

integer

Linked CRSP PERMCO, 0 if no CRSP company link exists

LINKPRIM

char(3)

Primary issue marker for the link. This marker is based on Compustat Primary/Joiner flag (PRIMISS), but may be overridden by CRSP in some cases. Values are:

C – Primary, assigned by CRSP to resolve ranges of overlapping or missing primary markers from Compustat in order to produce one primary security throughout the company history.

N – Secondary, assigned by CRSP to override Compustat. Compustat allows a US security and a Canadian security issued by the same company to both be marked as Primary at the same time. For purposes of the link, CRSP allows only one primary at a time and marks the others as N.

LINKTYPE

char(3)

Link type code. Each link is given a code describing the connection between the CRSP and Compustat data. Values are:

LC – Link research complete. Standard connection between databases.

LU – Unresearched link to issue by CUSIP

LX – Link to a security that trades on another exchange system not included in CRSP data.

LD – Duplicate Link to a security. Another GVKEY/IID is a better link to that CRSP record.

LN – Primary link exists but Compustat does not have prices.

LS – Link valid for this security only. Other CRSP PERMNOs with the same PERMCO will link to other GVKEYs.

NR – No link available, confirmed by research

NU – No link available, not yet confirmed

I download the link history table as of January 30, 2015. I delete records without a link found (about 67% of all records; remember the link history table is Compustat-centric and the Compustat universe is bigger than the CRSP universe). For remaining records with a link found, I present the following statistics to give you a sense of the values of LINKPRIM, LINKTYPE, and LIID. As you can see, the vast majority of the primary issue marker is identified by Compustat, and “LC” and “LU” types of links constitute about 90% of all identified links.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

. tab linkprim

Primary |

Link Marker | Freq. Percent Cum.

------------+-----------------------------------

C | 7,345 23.41 23.41

J | 359 1.14 24.55

N | 907 2.89 27.45

P | 22,764 72.55 100.00

------------+-----------------------------------

Total | 31,375 100.00

. tab linktype

Link Type |

Codd | Freq. Percent Cum.

------------+-----------------------------------

LC | 11,524 36.73 36.73

LD | 141 0.45 37.18

LN | 274 0.87 38.05

LS | 1,845 5.88 43.93

LU | 16,622 52.98 96.91

LX | 969 3.09 100.00

------------+-----------------------------------

Total | 31,375 100.00

. tab liid

Security-le |

vel |

Identifier | Freq. Percent Cum.

------------+-----------------------------------

00X | 2,369 7.55 7.55

01 | 25,645 81.74 89.29

01C | 897 2.86 92.15

02 | 961 3.06 95.21

02C | 36 0.11 95.32

03 | 209 0.67 95.99

03C | 21 0.07 96.06

04 | 62 0.20 96.25

04C | 3 0.01 96.26

05 | 23 0.07 96.34

05C | 1 0.00 96.34

06 | 7 0.02 96.36

06C | 2 0.01 96.37

07 | 4 0.01 96.38

07C | 1 0.00 96.39

08 | 2 0.01 96.39

09 | 1 0.00 96.40

10 | 2 0.01 96.40

19 | 1 0.00 96.40

19C | 1 0.00 96.41

90 | 929 2.96 99.37

90C | 7 0.02 99.39

91 | 72 0.23 99.62

92 | 14 0.04 99.67

93 | 9 0.03 99.69

95 | 2 0.01 99.70

96 | 1 0.00 99.70

99 | 2 0.01 99.71

99X | 91 0.29 100.00

------------+-----------------------------------

Total | 31,375 100.00

The merging code

You may notice the following announcement on the CCM product:

As of the February 2014 release, USEDFLAG is no longer used in the WRDS CCM web queries. Please select LINKTYPES LC, LU, and LS for the same results. These represent the vast majority of the links between CRSP securities and Compustat companies, without introducing duplicate data.

The WRDS-created linking dataset (ccmxpf_linktable) has been deprecated. It will continue to be created for a transition period of 1 year. SAS programmers should use the Link History dataset (ccmxpf_lnkhist) from CRSP.

This suggests that many old merging codes should be updated accordingly. Based on the explanation above, the most important query filters are LINKPRIM, LINKTYPE, LINKDT and LINKENDDT. LINKPRIM is used to select only primary security. LINKTYPE is used to ensure accuracy. LINKDT and LINKENDDT are used to ensure validity of a link at a give time. I believe that the following code is better than most sample codes I have seen: