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.
WRDSMerger.AbstractIdentifierWRDSMerger.CIKWRDSMerger.CusipWRDSMerger.Cusip6WRDSMerger.FirmIdentifierWRDSMerger.GVKeyWRDSMerger.HdrCusipWRDSMerger.HdrCusip6WRDSMerger.IbesTickerWRDSMerger.NCusipWRDSMerger.NCusip6WRDSMerger.PermcoWRDSMerger.PermnoWRDSMerger.RPEntityWRDSMerger.SecIDWRDSMerger.SecurityIdentifierWRDSMerger.Ticker
WRDSMerger.AbstractIdentifier — Type
Supertype for all Firm Identifiers
Firm Identifiers
Firm identifiers represent a company across all of its securities.
WRDSMerger.FirmIdentifier — Type
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.
WRDSMerger.GVKey — Type
GVKey <: FirmIdentifier
GVKey(s::Union{<:Real, <:AbstractString})::GVKey
GVKey(x::AbstractIdentifier, d::Date)::StringGVKey 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"WRDSMerger.CIK — Type
CIK <: FirmIdentifier
CIK(s::Union{<:Real, <:AbstractString})::CIK
CIK(x::AbstractIdentifier, d::Date)::StringCIK 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"WRDSMerger.Permco — Type
Permco <: FirmIdentifier
Permco(x::Real)::Permco
Permco(x::AbstractIdentifier, d::Date)::IntPermco is the primary firm identifier in the CRSP universe.
Example
julia> Permco(20436) # Permco for Chase
Permco(20436)
julia> Permco(NCusip6("46625H"), Date(2020))
20436WRDSMerger.Cusip6 — Type
Cusip6 <: FirmIdentifier
Cusip6(s::AbstractString)::Cusip6
Cusip6(x::Cusip)::Cusip6
Cusip6(x::AbstractIdentifier, d::Date)::StringCusip6 is the firm identifier component of Cusip. It can contain numbers or letters (with a maximum length of 6 characters).
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"WRDSMerger.NCusip6 — Type
NCusip6 <: FirmIdentifier
NCusip6(s::AbstractString)::NCusip6
NCusip6(x::NCusip)::NCusip6
NCusip6(x::AbstractIdentifier, d::Date)::StringNCusip6 is the firm identifier component of NCusip. It can contain numbers or letters (with a maximum length of 6 characters).
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"WRDSMerger.HdrCusip6 — Type
Cusip6 <: FirmIdentifier
Cusip6(s::AbstractString)::Cusip6
Cusip6(x::Cusip)::Cusip6
Cusip6(x::AbstractIdentifier, d::Date)::StringCusip6 is the firm identifier component of Cusip. It can contain numbers or letters (with a maximum length of 6 characters).
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"WRDSMerger.RPEntity — Type
RPEntity <: FirmIdentifier
RPEntity(x::String)::RPEntity
RPEntity(x::AbstractIdentifier, d::Date)::StringRPEntity 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"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"Security Identifiers
Security identifiers represent a specific stock, bond, or other instrument.
WRDSMerger.SecurityIdentifier — Type
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.
WRDSMerger.Permno — Type
Permno <: SecurityIdentifier
Permno(x::Real)::Permno
Permno(x::AbstractIdentifier, d::Date)::IntPermno 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))
47896WRDSMerger.Cusip — Type
Cusip <: SecurityIdentifier
Cusip(s::AbstractString)::Cusip
Cusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::Cusip
Cusip(x::AbstractIdentifier, d::Date)::StringCusip 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.
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.
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"WRDSMerger.NCusip — Type
NCusip <: SecurityIdentifier
NCusip(s::AbstractString)::NCusip
NCusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::NCusip
NCusip(x::AbstractIdentifier, d::Date)::StringNCusip 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.
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).
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"WRDSMerger.HdrCusip — Type
Cusip <: SecurityIdentifier
Cusip(s::AbstractString)::Cusip
Cusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::Cusip
Cusip(x::AbstractIdentifier, d::Date)::StringCusip 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.
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.
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"WRDSMerger.Ticker — Type
Ticker <: SecurityIdentifier
Ticker(s::AbstractString)::Ticker
Ticker(x::AbstractIdentifier, d::Date)::StringTicker is a stock market ticker that is often seen on the NYSE or other exchanges. It typically consists of 1-4 characters.
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"WRDSMerger.IbesTicker — Type
IbesTicker <: SecurityIdentifier
IbesTicker(s::AbstractString)::IbesTicker
IbesTicker(x::AbstractIdentifier, d::Date)::StringIbesTicker 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"WRDSMerger.SecID — Type
SecID <: SecurityIdentifier
SecID(x::Real)::SecID
SecID(x::AbstractIdentifier, d::Date)::IntSecID is the primary identifier within the OptionMetrics database.
julia> SecID(102936) # SecID for Chase
SecID(102936)
julia> SecID(NCusip("46625H10"), Date(2020))
102936