Identifier Types

This page lists all identifier types provided by default. Identifiers are thin wrappers around String or Int values that carry type information, enabling the linking system to dispatch to the correct conversion method.

There are two categories:

  • Firm identifiers (FirmIdentifier): identify a company (e.g., GVKey, CIK, Permco)
  • Security identifiers (SecurityIdentifier): identify a specific security (e.g., Permno, Cusip, Ticker)

Some security identifiers have a "parent" firm identifier. For example, NCusip (8-character CUSIP) has parent NCusip6 (6-character CUSIP). This parent relationship is used for fallback matching — see Parent Firms in Default Behavior.

Firm Identifiers

Firm identifiers represent a company across all of its securities.

WRDSMerger.FirmIdentifierType

A FirmIdentifier specifies a specific firm over a given date range and is opposed to a SecurityIdentifier. In a standard database, a single FirmIdentifier can have multiple SecurityIdentifiers but a SecurityIdentifier should only have one FirmIdentifier.

Examples include GVKey, Permco and Cusip6.

source
WRDSMerger.GVKeyType
GVKey <: FirmIdentifier

GVKey(s::Union{<:Real, <:AbstractString})::GVKey

GVKey(x::AbstractIdentifier, d::Date)::String

GVKey is the primary identifier in the Compustat universe It only contains numeric values, though is often represented as a string with 6 digits, therefore, it is stored as a String.

Example

julia> GVKey(2968) # GVKey for Chase
GVKey("002968")

julia> GVKey("002968")
GVKey("002968")

julia> GVKey(Permno(47896), Date(2020))
"002968"
source
WRDSMerger.CIKType
CIK <: FirmIdentifier

CIK(s::Union{<:Real, <:AbstractString})::CIK

CIK(x::AbstractIdentifier, d::Date)::String

CIK is a common identifier outside of WRDS It only contains numeric values, though is often represented as a string with 10 digits, therefore, it is stored as a String.

Example

julia> CIK(19617) # CIK for Chase
CIK("0000019617")

julia> CIK("0000019617")
CIK("0000019617")

julia> CIK(GVKey(2968), Date(2020))
"0000019617"

julia> CIK(GVKey(2968)) # Date for GVKey <-> CIK is unnecessary
"0000019617"
source
WRDSMerger.PermcoType
Permco <: FirmIdentifier

Permco(x::Real)::Permco

Permco(x::AbstractIdentifier, d::Date)::Int

Permco is the primary firm identifier in the CRSP universe.

Example

julia> Permco(20436) # Permco for Chase
Permco(20436)

julia> Permco(NCusip6("46625H"), Date(2020))
20436
source
WRDSMerger.Cusip6Type
Cusip6 <: FirmIdentifier

Cusip6(s::AbstractString)::Cusip6

Cusip6(x::Cusip)::Cusip6

Cusip6(x::AbstractIdentifier, d::Date)::String

Cusip6 is the firm identifier component of Cusip. It can contain numbers or letters (with a maximum length of 6 characters).

Note

Cusip6 is a parameterized type: NCusip6 = Cusip6{:historical} and HdrCusip6 = Cusip6{:current}. Calling Cusip6(x) defaults to historical (NCusip6).

In CRSP V1, the column cusip (first 6 chars) was the current/header value and ncusip (first 6 chars) was historical. In CRSP V2, the column cusip (first 6 chars) is historical and hdrcusip (first 6 chars) is the current value.

Example

julia> HdrCusip6("46625H") # Cusip6 for Chase
HdrCusip6("46625H")

julia> HdrCusip6(HdrCusip("46625H10")) # Cusip6 is the first 6 digits of a Cusip
HdrCusip6("46625H")

julia> HdrCusip6(Permno(47896), Date(2020))
"46625H"

Related to the note on the difference between Cusip6 and NCusip6:

julia> HdrCusip6(Permno(47896), Date(2020))
"46625H"

julia> NCusip6(Permno(47896), Date(2020))
"46625H"

julia> HdrCusip6(Permno(47896), Date(1998))
"46625H"

julia> NCusip6(Permno(47896), Date(1998))
"16161A"
source
WRDSMerger.NCusip6Type
NCusip6 <: FirmIdentifier

NCusip6(s::AbstractString)::NCusip6

NCusip6(x::NCusip)::NCusip6

NCusip6(x::AbstractIdentifier, d::Date)::String

NCusip6 is the firm identifier component of NCusip. It can contain numbers or letters (with a maximum length of 6 characters).

Note

NCusip6 is from CRSP v1 where it would provide a historical view of the first 6 characters of the Cusip, while Cusip6 would provide the most recently available 6 characters.

In CRSP v2, Cusip6 would represent the historical information while HdrCusip6 would represent the most recently available 6 characters.

Example

julia> NCusip6("46625H") # NCusip6 for Chase
NCusip6("46625H")

julia> NCusip6(NCusip("46625H10")) # NCusip6 is the first 6 digits of a Cusip
NCusip6("46625H")

julia> NCusip6(Permno(47896), Date(2020))
"46625H"

Related to the note on the difference between Cusip6 and NCusip6:

julia> HdrCusip6(Permno(47896), Date(2020))
"46625H"

julia> NCusip6(Permno(47896), Date(2020))
"46625H"

julia> HdrCusip6(Permno(47896), Date(1998))
"46625H"

julia> NCusip6(Permno(47896), Date(1998))
"16161A"
source
WRDSMerger.HdrCusip6Type
Cusip6 <: FirmIdentifier

Cusip6(s::AbstractString)::Cusip6

Cusip6(x::Cusip)::Cusip6

Cusip6(x::AbstractIdentifier, d::Date)::String

Cusip6 is the firm identifier component of Cusip. It can contain numbers or letters (with a maximum length of 6 characters).

Note

Cusip6 is a parameterized type: NCusip6 = Cusip6{:historical} and HdrCusip6 = Cusip6{:current}. Calling Cusip6(x) defaults to historical (NCusip6).

In CRSP V1, the column cusip (first 6 chars) was the current/header value and ncusip (first 6 chars) was historical. In CRSP V2, the column cusip (first 6 chars) is historical and hdrcusip (first 6 chars) is the current value.

Example

julia> HdrCusip6("46625H") # Cusip6 for Chase
HdrCusip6("46625H")

julia> HdrCusip6(HdrCusip("46625H10")) # Cusip6 is the first 6 digits of a Cusip
HdrCusip6("46625H")

julia> HdrCusip6(Permno(47896), Date(2020))
"46625H"

Related to the note on the difference between Cusip6 and NCusip6:

julia> HdrCusip6(Permno(47896), Date(2020))
"46625H"

julia> NCusip6(Permno(47896), Date(2020))
"46625H"

julia> HdrCusip6(Permno(47896), Date(1998))
"46625H"

julia> NCusip6(Permno(47896), Date(1998))
"16161A"
source
WRDSMerger.RPEntityType
RPEntity <: FirmIdentifier

RPEntity(x::String)::RPEntity

RPEntity(x::AbstractIdentifier, d::Date)::String

RPEntity is used within RavenPack to identify different entities.

Example

julia> RPEntity("619882") # RPEntity for Chase
RPEntity("619882")

julia> RPEntity(NCusip6("46625H"), Date(2020))
"619882"

julia> NCusip6(RPEntity("619882"), Date(2020))
"46625H"
Note

The RavenPack links are especially messy, for example, there are two links for RPEntity -> NCusip6 from 2001-01-01 - 2001-05-31, and there is not easy way to distinguish these. This package simply returns the first value in such cases

julia> RPEntity(NCusip6("46625H"), Date(2001, 3))
"619882"

julia> RPEntity(NCusip6("616880"), Date(2001, 3))
"619882"

julia> NCusip6(RPEntity("619882"), Date(2001, 3))
"46625H"
source

Security Identifiers

Security identifiers represent a specific stock, bond, or other instrument.

WRDSMerger.SecurityIdentifierType

A SecurityIdentifier specifies a specific firm over a given date range and is opposed to a FirmIdentifier. In a standard database, a single FirmIdentifier can have multiple SecurityIdentifiers but a SecurityIdentifier should only have one FirmIdentifier.

Examples include Permno, Cusip and Ticker.

source
WRDSMerger.PermnoType
Permno <: SecurityIdentifier

Permno(x::Real)::Permno

Permno(x::AbstractIdentifier, d::Date)::Int

Permno is the primary security identifier in the CRSP universe, it is also one of the most common methods of linking between databases since it is easy to find links to Cusip and Compustat (GVKey), and Cusip.

Example

julia> Permno(47896) # Permno for Chase
Permno(47896)

julia> Permno(NCusip6("46625H"), Date(2020))
47896
source
WRDSMerger.CusipType
Cusip <: SecurityIdentifier

Cusip(s::AbstractString)::Cusip

Cusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::Cusip

Cusip(x::AbstractIdentifier, d::Date)::String

Cusip is a common identifier within and outside of WRDS WRDS tracks older Cusips as NCusip all Cusips are made up of 3 parts, issuer (first 6 characters), issue (next 2 characters), and a checksum most databases in WRDS only use the 8 characters. If 9 digits are passed or the checksum is explicitly passed, the checksum is validated and a warning is given if it is an invalid checksum.

Note

Cusip is a parameterized type: NCusip = Cusip{:historical} and HdrCusip = Cusip{:current}. Calling Cusip(x) defaults to historical (NCusip).

In CRSP V1, the column cusip was the current/header value and ncusip was historical. In CRSP V2, the column cusip is historical and hdrcusip is the current value. The default of Cusip(x) returning a historical identifier is consistent with the V2 convention and is generally the safer default since the inexact date matching (see choose_best_match) will still find the correct link when only one match exists.

Note

Cusip only stores 8 characters (not the checksum digit) and, by default, only returns those 8 characters. This means that if using a join function on a set of Cusips with 9 characters and the default output, there will be no matches. It is easiest to shorten the 9 digit Cusips to 8 digits before joining.

Example

julia> HdrCusip("46625H10") # Cusip for Chase
HdrCusip("46625H10")

julia> HdrCusip("46625H", "10") # can also provide the parts separately
HdrCusip("46625H10")

julia> HdrCusip(Permno(47896), Date(2020))
"46625H10"

Related to the note on the difference between Cusip and NCusip:

julia> HdrCusip(Permno(47896), Date(2020))
"46625H10"

julia> NCusip(Permno(47896), Date(2020))
"46625H10"

julia> HdrCusip(Permno(47896), Date(1998))
"46625H10"

julia> NCusip(Permno(47896), Date(1998))
"16161A10"
source
WRDSMerger.NCusipType
NCusip <: SecurityIdentifier
    
NCusip(s::AbstractString)::NCusip

NCusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::NCusip

NCusip(x::AbstractIdentifier, d::Date)::String

NCusip is a type alias for Cusip{:historical}, representing the historical Cusip identifier for a security. It is a common identifier within and outside of WRDS.

All NCusips are made up of 3 parts: issuer (first 6 characters), issue (next 2 characters), and a checksum. Most databases in WRDS only use the 8 characters. If 9 digits are passed or the checksum is explicitly passed, the checksum is validated and a warning is given if it is an invalid checksum.

Note

In CRSP V1, ncusip was the column name for the historical Cusip. In CRSP V2, the plain cusip column is the historical value (and maps to NCusip), while hdrcusip is the current/header value (mapped to HdrCusip). NCusip is equivalent to calling Cusip(x) (which defaults to historical).

Note

NCusip only stores 8 characters (not the checksum digit) and, by default, only returns those 8 characters. This means that if using a join function on a set of NCusips with 9 characters and the default output, there will be no matches. It is easiest to shorten the 9 digit NCusips to 8 digits before joining.

Example

julia> NCusip("46625H10") # NCusip for Chase
NCusip("46625H10")

julia> NCusip("46625H", "10") # can also provide the parts separately
NCusip("46625H10")

julia> NCusip(Permno(47896), Date(2020))
"46625H10"

Related to the note on the difference between Cusip and NCusip:

julia> HdrCusip(Permno(47896), Date(2020))
"46625H10"

julia> NCusip(Permno(47896), Date(2020))
"46625H10"

julia> HdrCusip(Permno(47896), Date(1998))
"46625H10"

julia> NCusip(Permno(47896), Date(1998))
"16161A10"
source
WRDSMerger.HdrCusipType
Cusip <: SecurityIdentifier

Cusip(s::AbstractString)::Cusip

Cusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::Cusip

Cusip(x::AbstractIdentifier, d::Date)::String

Cusip is a common identifier within and outside of WRDS WRDS tracks older Cusips as NCusip all Cusips are made up of 3 parts, issuer (first 6 characters), issue (next 2 characters), and a checksum most databases in WRDS only use the 8 characters. If 9 digits are passed or the checksum is explicitly passed, the checksum is validated and a warning is given if it is an invalid checksum.

Note

Cusip is a parameterized type: NCusip = Cusip{:historical} and HdrCusip = Cusip{:current}. Calling Cusip(x) defaults to historical (NCusip).

In CRSP V1, the column cusip was the current/header value and ncusip was historical. In CRSP V2, the column cusip is historical and hdrcusip is the current value. The default of Cusip(x) returning a historical identifier is consistent with the V2 convention and is generally the safer default since the inexact date matching (see choose_best_match) will still find the correct link when only one match exists.

Note

Cusip only stores 8 characters (not the checksum digit) and, by default, only returns those 8 characters. This means that if using a join function on a set of Cusips with 9 characters and the default output, there will be no matches. It is easiest to shorten the 9 digit Cusips to 8 digits before joining.

Example

julia> HdrCusip("46625H10") # Cusip for Chase
HdrCusip("46625H10")

julia> HdrCusip("46625H", "10") # can also provide the parts separately
HdrCusip("46625H10")

julia> HdrCusip(Permno(47896), Date(2020))
"46625H10"

Related to the note on the difference between Cusip and NCusip:

julia> HdrCusip(Permno(47896), Date(2020))
"46625H10"

julia> NCusip(Permno(47896), Date(2020))
"46625H10"

julia> HdrCusip(Permno(47896), Date(1998))
"46625H10"

julia> NCusip(Permno(47896), Date(1998))
"16161A10"
source
WRDSMerger.TickerType
Ticker <: SecurityIdentifier

Ticker(s::AbstractString)::Ticker

Ticker(x::AbstractIdentifier, d::Date)::String

Ticker is a stock market ticker that is often seen on the NYSE or other exchanges. It typically consists of 1-4 characters.

Note

Ticker should be kept distinct from IbesTicker. IbesTicker is within the IBES database and often differs from Ticker.

Example

julia> Ticker("JPM") # Ticker for Chase
Ticker("JPM")

julia> Ticker(Permno(47896), Date(2020))
"JPM"
source
WRDSMerger.IbesTickerType
IbesTicker <: SecurityIdentifier

IbesTicker(s::AbstractString)::IbesTicker

IbesTicker(x::AbstractIdentifier, d::Date)::String

IbesTicker is the primary identifier in the IBES universe and typically consists of 1-4 characters.

Example

julia> IbesTicker("CHL") # IbesTicker for Chase
IbesTicker("CHL")

julia> IbesTicker(Permno(47896), Date(2020))
"CHL"
source
WRDSMerger.SecIDType
SecID <: SecurityIdentifier

SecID(x::Real)::SecID

SecID(x::AbstractIdentifier, d::Date)::Int

SecID is the primary identifier within the OptionMetrics database.

julia> SecID(102936) # SecID for Chase
SecID(102936)

julia> SecID(NCusip("46625H10"), Date(2020))
102936
source