diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2b79a0e..2f6332e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: version: - - '1.5' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. + - '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'. - '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia. os: - ubuntu-latest diff --git a/Project.toml b/Project.toml index 71886b6..bd46771 100644 --- a/Project.toml +++ b/Project.toml @@ -1,35 +1,27 @@ name = "WRDSMerger" uuid = "59d27aa3-834e-4232-9046-52ef43e86786" authors = ["junder873 "] -version = "0.4.0" +version = "0.5.0" [deps] -AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" -BusinessDays = "4f18b42c-503e-5345-9536-bb0f25fc7038" DBInterface = "a10d1c49-ce27-4219-8d33-6db1a4562965" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" LibPQ = "194296ae-ab2e-5f79-8cd4-7183a0a5a0d1" -LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" -ShiftedArrays = "1277b4bf-5013-50f5-be3d-901d8477a67a" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" -StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] -AbstractTrees = "0.3" -BusinessDays = "0.9" -DBInterface = "2.4" -DataFrames = "1.2" -LibPQ = "1.8" -ShiftedArrays = "1" -julia = "1.5" -StatsBase = "0.33" +DBInterface = "2.5" +DataFrames = "1.5" +LibPQ = "1.15" +julia = "1.8" [extras] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" SQLite = "0aa819cd-b072-5ff4-a722-6bc24af294d9" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" [targets] -test = ["Test", "SQLite", "CSV"] +test = ["Test", "SQLite", "CSV", "Documenter"] diff --git a/docs/Project.toml b/docs/Project.toml index 9311ade..87c46b3 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,2 +1,6 @@ [deps] -Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" \ No newline at end of file +CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" +WRDSMerger = "59d27aa3-834e-4232-9046-52ef43e86786" diff --git a/docs/make.jl b/docs/make.jl index 2af7bdc..c4c92a1 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,51 @@ using WRDSMerger using Documenter +DocMeta.setdocmeta!( + WRDSMerger, + :DocTestSetup, + quote + data_dir = joinpath("..", "test", "data") + using CSV, DataFrames, WRDSMerger, Dates + files = [ + "crsp_links", + "crsp_comp_links", + "gvkey_cik_links", + "ibes_links", + "option_links", + "ravenpack_links" + ] + funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, + generate_ibes_links, + generate_option_crsp_links, + generate_ravenpack_links + ] + for (file, fun) in zip(files, funs) + fun( + DataFrame( + CSV.File(joinpath(data_dir, file * ".csv")) + ) + ) + end + end; + recursive=true +) + Documenter.makedocs( modules = [WRDSMerger], sitename = "WRDSMerger.jl", -) \ No newline at end of file + pages = [ + "Introduction" => "index.md", + "Downloading WRDS Data" => "download_data.md", + "Links Between WRDS Data" => [ + "Linking Basics" => "basic_linking.md", + "Default Behavior" => "default_behavior.md", + "Identifier Types" => "linking_identifiers.md", + "Internals" => "linking_internals.md" + ], + "Miscellaneous Utilities" => "misc_utilities.md" + ] +) diff --git a/docs/src/basic_linking.md b/docs/src/basic_linking.md new file mode 100644 index 0000000..f082bcb --- /dev/null +++ b/docs/src/basic_linking.md @@ -0,0 +1,134 @@ + +```@setup default_behavior +data_dir = joinpath("..", "..", "test", "data") +using CSV, DataFrames, WRDSMerger, Dates +files = [ + "crsp_links", + "crsp_comp_links", + "gvkey_cik_links", +] +funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, +] +for (file, fun) in zip(files, funs) + fun( + DataFrame( + CSV.File(joinpath(data_dir, file * ".csv")) + ) + ) +end +create_all_links() +``` +# Basics of Linking Identifiers + +A core part of this package is to provide a simple and consistent interface for linking different identifiers in WRDS. One of the primary goals is to reduce the overhead of remembering how exactly to link one dataset to another. + +## Downloading and Saving Data + +To do so, first download the necessary data from WRDS. This package provides download functions to do so (see [Linking Download Functions](@ref)), which are automatically called by respective generating functions (see [Generating LinkPair Functions](@ref)). The generating functions take in a `DataFrame` (which expects certain column names) and creates the necessary functions between its identifiers. Finally, calling `create_all_links()` will create the remaining links that the tables do not provide. + +To provide an example: +```julia +julia> db = ODBC.Connection("wrds-pgdata-64"); +julia> generate_crsp_links(db) # downloads the data, creates links between +# Permno <-> Permco, Permno <-> NCusip, etc. +# and returns the data that is downloaded + +julia> generate_comp_crsp_links(db) # similar to generate_crsp_links + +julia> create_all_links() # defines functions between NCusip <-> GVKey, +# Ticker <-> GVKey, etc. +``` + +The generate functions return the DataFrame that is downloaded so you can save it locally (with CSV.jl, Arrow.jl, etc.) and can use again as opposed to re-downloading the data. + +This package also provides a simple function that runs all of these: +```julia +julia> download_all_links(db) +``` +Which downloads all 6 default tables and returns those 6 DataFrames. Note that if your WRDS account lacks access to one of the tables, you need to change which items are downloaded. + +For example, the code I use when starting a project is: +```julia +data_dir = joinpath(path_to_saved_files) +dfs = download_all_links(db) +files = [ + "crsp_links", + "crsp_comp_links", + "gvkey_cik_links", + "ibes_links", + "option_links", + "ravenpack_links" +] +# I prefer Arrow.jl and feather files, replace with CSV.jl if desired +for (df, file) in zip(dfs, files) + Arrow.write(joinpath(data_dir, file * ".feather"), df) +end +``` + +Then, whenever I reload the project: +```julia +funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, + generate_ibes_links, + generate_option_crsp_links, + generate_ravenpack_links +] +for (file, f) in zip(files, funs) + @chain joinpath(data_dir, file * ".feather") begin + Arrow.Table + DataFrame + copy + f + end +end +create_all_links() +``` + +## Linking Identifiers + +Once the initial data is downloaded and necessary functions are created, the package provides a consistent set of methods to convert one identifier to any other. This follows the pattern: +``` +(ID You Want)((ID You Have)(value), Date for conversion) +``` +For example: +```@repl default_behavior +GVKey(Permno(47896), Date(2020)) +NCusip(CIK(19617), Date(2020)) # works for Int or String +CIK(Permno(47896), Date(2020)) +CIK(NCusip("46625H21"), Date(2020)) +``` +As you can see, this includes cases where there is not a table providing a direct link (CIK <-> Permno, CIK <-> NCusip). This makes it easy to link the varied datasets in WRDS. + +These functions can be easily used with broadcasting: +```@repl +GVKey.(Permno.([47896, 44206, 46703]), Date(2020)) +GVKey.(Permno.([47896, 44206, 46703]), [Date(2018), Date(2019), Date(2020)]) +``` + +Or with other packages such as [DataFramesMeta.jl](https://juliadata.github.io/DataFramesMeta.jl/stable/): +```julia +@chain df begin + @rtransform(:gvkey = GVKey(Permno(:permno), :date)) +end +``` + + +All of the identifiers that this package provides by default are seen in [Identifier Types](@ref). This is expandable as discussed in [Adding New Identifiers](@ref). + +## Generating LinkPair Functions + +This section describes the default functions that exist to generate the necessary links. + +```@docs +generate_crsp_links +generate_comp_crsp_links +generate_comp_cik_links +generate_ibes_links +generate_option_crsp_links +generate_ravenpack_links +``` \ No newline at end of file diff --git a/docs/src/default_behavior.md b/docs/src/default_behavior.md new file mode 100644 index 0000000..93c8190 --- /dev/null +++ b/docs/src/default_behavior.md @@ -0,0 +1,88 @@ +```@setup default_behavior +data_dir = joinpath("..", "..", "test", "data") +using CSV, DataFrames, WRDSMerger, Dates +files = [ + "crsp_links", + "crsp_comp_links", + "gvkey_cik_links", + "ibes_links", + "option_links", + "ravenpack_links" +] +funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, + generate_ibes_links, + generate_option_crsp_links, + generate_ravenpack_links +] +for (file, fun) in zip(files, funs) + fun( + DataFrame( + CSV.File(joinpath(data_dir, file * ".csv")) + ) + ) +end +``` + +# Default Behavior + +This package has some defaults that are important to be aware of during use. + +## Different Return Types + +The general design principal in Julia is that if a type is a function name, it should return that type. In this package, this is not always the case. When an [`AbstractIdentifier`](@ref) uses an external type (e.g. `Int`), it will return that `AbstractIdentifier`. However, when an `AbstractIdentifier` is used on another `AbstractIdentifier`, it will most often return the underlying value. For example: +```@repl default_behavior +Permno(47896) # returns the type Permno +Permno(Permco(20436), Date(2020)) # an Int type +``` + +The reason for this difference is that the `AbstractIdentifier` types are primarily meant for internal use and communicating information to the functions, but it is more often necessary to have the common Julia type for later joins. If it is needed to have the `AbstractIdentifier`, then run: +```@repl default_behavior +WRDSMerger.convert_identifier(Permno, Permco(20436), Date(2020)) +``` + +## Default Options in Conversions + +### Parent Firms + +Certain [`SecurityIdentifier`](@ref)s have a direct link to a parent firm, most obviously [`Cusip`](@ref) and [`NCusip`](@ref) (with [`Cusip6`](@ref) and [`NCusip6`](@ref)). In certain situations, it can make sense to allow a match to occur through these parent firms, such as when the end goal is to match a `SecurityIdentifier` to a [`FirmIdentifier`](@ref). + +For example, consider the case of `NCusip("46625H21")`, which is not in the data. Therefore, when trying to convert his to another `SecurityIdentifier`, it will return `missing` since there is not an exact match: +```@repl default_behavior +Permno(NCusip("46625H21"), Date(2020)) +``` +However, if trying to match this `NCusip` to a `FirmIdentifier`, then it will return a match: +```@repl default_behavior +Permco(NCusip("46625H21"), Date(2020)) +``` +This is because while the `NCusip` is not in the data, the `NCusip6("46625H")` is: +```@repl default_behavior +Permco(NCusip6("46625H"), Date(2020)) +``` +The logic here is that it should not matter if a particular security does not match to a firm if the parent firm of that security does match to a firm. This is very useful if the integrity of the `Cusip` values is in question. This behavior can be disabled or enabled by setting `allow_parent_firm`; +```@repl default_behavior +Permno(NCusip("46625H21"), Date(2020); allow_parent_firm=true) +Permco(NCusip("46625H21"), Date(2020); allow_parent_firm=false) +``` + +### Outside of Date Ranges and Singular Matches + +Many links are supposed to be only valid for a specific date range. For example, linking `NCusip("16161A10")` to `Permno(47896)` is only valid between 1996-04-01 to 2001-01-01. However, this `NCusip` only ever links to that `Permno`, so the default behavior in this package is to provide that match: +```@repl default_behavior +Permno(NCusip("16161A10"), Date(2020)) # outside date range +``` +If the link does not only provide one potential result (e.g., if that `NCusip` also could go to a different `Permno`), then this will return `missing`. The default behavior can be disabled by setting `allow_inexact_date=false`: +```@repl default_behavior +Permno(NCusip("16161A10"), Date(2020); allow_inexact_date=false) # outside date range +``` + +## Supremacy of Permno + +In WRDS, Permnos are one of the easiest items to link. For example, there are easily accessible tables for linking GVKey <-> Permno, IbesTicker <-> Permno, and NCusip <-> Permno. This makes it very useful for most links. Therefore, when this package is determining the best path for linking two identifiers that are not directly linked (e.g., RPEntity <-> GVKey), this package will default to using Permno even if other paths exist of equal length. + +For example, by default, this package links RPEntity to NCusip6. NCusip6 has direct links to both Permno and Permco, both of which directly link to GVKey. The default in this package will choose the path that goes through Permno (RPentity -> NCusip6 -> Permno -> GVKey). + +!!! note + If there is a shorter path, then it will still choose that (e.g., SecID -> NCusip -> NCusip6 -> RPEntity instead of SecID -> NCusip -> Permno -> NCusip6 -> RPEntity). \ No newline at end of file diff --git a/docs/src/download_data.md b/docs/src/download_data.md new file mode 100644 index 0000000..8012c0c --- /dev/null +++ b/docs/src/download_data.md @@ -0,0 +1,27 @@ + +# Downloading WRDS Data + + +## Explore WRDS +```@docs +list_libraries +list_tables +describe_table +get_table +raw_sql +``` + + +## Compustat +```@docs +comp_data +``` + +## CRSP +```@docs +crsp_stocknames +crsp_market +crsp_data +crsp_delist +crsp_adjust +``` \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index 31a73ee..260e272 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,5 +1,6 @@ # WRDSMerger.jl Docs + # Installation From the Julia REPL: ```julia @@ -49,44 +50,9 @@ WRDSMerger.default_tables["comp_fundq"] = "compa_fundq" ## ODBC vs LibPQ -The two largest packages I am aware of for connecting to a Postgres database in Lulia are [ODBC.jl](https://github.com/JuliaDatabases/ODBC.jl) and [LibPQ.jl](https://github.com/invenia/LibPQ.jl). Both of these have various advantages. +The two largest packages I am aware of for connecting to a Postgres database in Julia are [ODBC.jl](https://github.com/JuliaDatabases/ODBC.jl) and [LibPQ.jl](https://github.com/invenia/LibPQ.jl). Both of these have various advantages. Starting with LibPQ, adding LibPQ to your project is the full installation process. To use ODBC, an extra driver, with extra setup, needs to occur before use. In addition, as far as I can tell, LibPQ does not have a limit on length of query. Some functions in this package (such as `crsp_data`) create exceptionally long queries to reduce the total amount of data downloaded, which LibPQ handles easily. For ODBC, it is considerably faster at converting data to a DataFrame. For example, downloading the full CRSP Stockfile (`crsp.dsf`, which includes returns for every stock for each day and is about 100 million rows), takes about 4 minutes to download and make into a DataFrame with ODBC on a gigabit connection. LibPQ takes about 24 minutes. Most of this difference appears to be type instability while converting the LibPQ result to a DataFrame, since the initial LibPQ result only takes a minute and `@time` reports 80% garbage collection time. ODBC also stores your password separately (in the driver settings) making it a little easier to share a project without compromising your password. -# Explore WRDS -```@docs -list_libraries -list_tables -describe_table -get_table -raw_sql -``` - - -# Compustat -```@docs -comp_data -``` - -# CRSP -```@docs -crsp_stocknames -crsp_market -crsp_data -crsp_delist -crsp_adjust -``` - -# Merge -```@docs -link_identifiers -``` - -# Utilities -```@docs -range_join -check_schema_perms -approx_row_count -``` diff --git a/docs/src/linking_identifiers.md b/docs/src/linking_identifiers.md new file mode 100644 index 0000000..85ad60a --- /dev/null +++ b/docs/src/linking_identifiers.md @@ -0,0 +1,32 @@ + +# Identifier Types + +```@index +Pages = ["linking_identifiers.md"] +``` + +```@docs +AbstractIdentifier +``` + +## Firm Identifiers +```@docs +FirmIdentifier +GVKey +CIK +Permco +Cusip6 +NCusip6 +RPEntity +``` + +## Security Identifiers +```@docs +SecurityIdentifier +Permno +Cusip +NCusip +Ticker +IbesTicker +SecID +``` diff --git a/docs/src/linking_internals.md b/docs/src/linking_internals.md new file mode 100644 index 0000000..12f8e6e --- /dev/null +++ b/docs/src/linking_internals.md @@ -0,0 +1,189 @@ + +# Linking Internals + +## Underlying Methodology of `convert_identifier` + +```@docs +WRDSMerger.convert_identifier +``` + +## LinkPairs + +This packages primary storage method for links is an `AbstractLinkPair`, which is typically a `LinkPair`: +```@docs +LinkPair +``` + +Conceptually, a `LinkPair` provides a one direction link between T1 -> T2. These are typically stored in a dictionary for quick lookup: +```julia +Dict{T1, Vector{LinkPair{T1, T2}}}() +``` +and this package adds a function to `Dict` to convert an abstract vector of `LinkPair`s to such a dictionary: +```@docs +Dict +``` + +### Defining New `AbstractLinkPair`s + +While this package currently makes use of `LinkPair`, it might be easier for other identifiers to define a more complex `AbstractLinkPair`. A key component of an `AbstractLinkPair` is being able to compare when one link should be used as opposed to another, which this package refers to as priority. In some cases, there might be multiple values that determine a priority. For example, the link between [`GVKey`](@ref) <-> [`Permno`](@ref) has two columns, depending on the direction (e.g., going from `Permno` -> `GVKey`, "LC" > "LU" > "LS"...). This package converts these into a single number with decimals ("LC" = 8, "LU" = 7... and the other column, "P" = 0.3, "C" = 0.2 ..., added together). This is switched when defining the link between `GVKey` -> `Permno` ("LC" = 0.8, "P" = 3). An alternative way to define this would be to create a separate `AbstractLinkPair` type that would avoid adding and, perhaps, be clearer on methodology. For example, something like: +```julia +struct CrspCompLinkPair{T1<:AbstractIdentifier, T2<:AbstractIdentifier} <: AbstractLinkPair{T1, T2} + parent::T1 + child::T2 + dt1::Date# first date valid + dt2::Date# last date valid + comp_crsp_priority::Int + crsp_comp_priority::Int + function CrspCompLinkPair( + t1::T1, + t2::T2, + dt1::Date, + dt2::Date, + linktype::AbstractString, + linkprim::AbstractString + ) where {T1, T2} + comp_crsp_priority = if linkprim == "P" + 3 + elseif linkprim == "C" + 2 + elseif linkprim == "J" + 1 + end + crsp_comp_priority = if linktype == "LC" + 8 + elseif linktype == "LU" + 7 + elseif linktype == "LS" + 6 + elseif linktype == "LX" + 5 + elseif linktype == "LD" + 4 + elseif linktype == "LN" + 3 + elseif linktype == "NR" + 2 + elseif linktype == "NU" + 1 + end + new{T1, T2}(t1, t2, dt1, dt2, comp_crsp_priority, crsp_comp_priority) + end +end +``` + +While most of the default functions for `AbstractLinkPair` would work with this new type (`parentID`, `childID`, `min_date`, `max_date`, `Base.in`), the one that does not is `priority`, which determines which `AbstractLinkPair` is preferable. Since the direction of the link matters, two new `priority` functions are required: +```julia +function WRDSMerger.priority(data::CrspCompLinkPair{GVKey, T2}) where {T2<:AbstractIdentifier} + data.comp_crsp_priority + data.crsp_comp_priority / 10 +end + +function WRDSMerger.priority(data::CrspCompLinkPair{T1, GVKey}) where {T1<:AbstractIdentifier} + data.crsp_comp_priority + data.comp_crsp_priority / 10 +end +``` + +While this case is not used by default in this package, following similar methodology could allow for more complex priority structures. + +## Linking Download Functions + +```@docs +WRDSMerger.download_crsp_links +WRDSMerger.download_comp_crsp_links +WRDSMerger.download_comp_cik_links +WRDSMerger.download_ibes_links +WRDSMerger.download_option_crsp_links +WRDSMerger.download_ravenpack_links +``` + +## Changing The Priority for Permno + +A single company can have many securities, therefore, there might be multiple options when linking these items. For example, a single [`GVKey`](@ref) or [`Permco`](@ref) will match to multiple [`Permno`](@ref)s. In some tables in WRDS (such as in the case of `GVKey` <-> `Permno`), there are explicit primary identifier markers provided, improving the match. In others, there are not (as in `Permco` <-> `Permno`). This is a particular problem for `Permno` since this package prioritizes matches through `Permno` (as discussed in [Supremacy of Permno](@ref)). + +The most common method to resolve these matches is to find the `Permno` that has the largest market capitalization on the day of the match since that should be the primary identifier. This is difficult to do in a package like this where the values are, ideally, predetermined. Therefore, the default behavior is to average the market capitalization over the period of the link and choose the higher average market capitalization. This behavior is convenient (requiring only a single SQL download), but potentially inconsistent with the end goal. Specifically, if one link has a lower average market capitalization (perhaps due to a long time window where the value was lower) than another link, this package might pick the `Permno` with a smaller market capitalization on the day of the match. + +This is a proposed alternative that makes use of the [AbnormalReturns.jl](https://github.com/junder873/AbnormalReturns.jl) package to provide a quick lookup of the market capitalization just before the link: + +First, stock price data is required: +```julia +using WRDSMerger, DataFramesMeta, AbnormalReturns +df = raw_sql(wrds_conn, "SELECT permno, date, abs(prc) * shrout AS mkt_cap FROM crsp.dsf") +@rtransform!(df, :mkt_cap = coalesce(:mkt_cap, 0.0)) +``` + +!!! note + It is recommended to provide some filter on the WRDS download as the `crsp.dsf` file has over 100 million rows, downloading this data takes a lot of ram, peaking at ~20 GB. Most obviously, selecting dates beyond a certain point helps a lot. + +AbnormalReturns needs a market calendar, instead of downloading something, just reuse the dates from `df` and load that into a `MarketData` object: +```julia +mkt_data = MarketData( + @by(df, :date, :full_mkt = mean(:mkt_cap)), + df +) +``` + +Then we need to redefine how WRDSMerger goes about choosing between two links when the outcome is a `Permno`. It is also important to do some error checking since AbnormalReturns does not accept cases when the date is out of the range available or the `Permno` is not in the dataset. WRDSMerger determines priority uses the `is_higher_priority` function, which checks the priority of two `AbstractLinkPair`s and compares them. Therefore, changing the `priority` function slightly when the outcome is a `Permno` will create the necessary changes: +```julia +function WRDSMerger.priority( + data::AbstractLinkPair{T1, Permno}, + dt::Date; + mkt_data=mkt_data # need the market data defined above +) where {T1} + if dt < AbnormalReturns.cal_dt_min(mkt_data.calendar) || dt > AbnormalReturns.cal_dt_min(mkt_data.calendar) + return 0.0 + end + if dt > AbnormalReturns.cal_dt_min(mkt_data.calendar) + # typically, the market cap on the day before is checked + # but it is also important to avoid going outside the calendar + # range + dt = BusinessDays.advancebdays(mkt_data.calendar, dt, -1) + end + permno_val = WRDSMerger.childID(data) + if haskey(mkt_data.firmdata, permno_val) + coalesce( + mkt_data[permno_val, dt, :mkt_cap], # returns value or missing + 0.0 + ) + else + 0.0 + end +end +``` + +This method is obviously slower than the default setup, but would provide the market capitalization on the day before the match. + +This is not the default in this package since many of these operations are costly, particularly downloading the data. + +## Adding New Identifiers + +There are likely other identifiers in WRDS that are not included by default in this package, making it necessary to define a new identifier. This is quite easy. First, define a new type: +```julia +struct IdentiferName <: FirmIdentifier + val::String + IdentifierName(x::AbstractString) = new(x) +end + +WRDSMerger.value(x::IdentifierName) = x.val +``` +Replacing `FirmIdentifier` with `SecurityIdentifier` if necessary and choosing between `String` or `Int` or some other type. + +Next, provide the information that links this new identifier to some other identifier in the package. This is done by calling `new_link_method`: +```@docs +WRDSMerger.new_link_method +``` +Specifically the method with a vector of `AbstractLinkPair`s or the dictionary version. Therefore, you need to create a vector of these links, I will assume use of the `LinkPair` type, but this can be adjusted as discussed in [Defining New `AbstractLinkPair`s](@ref). A `LinkPair` requires 5 elements: the ID it is coming from (parent ID), the ID it is going to (child ID), a start and end date, and a priority (though the start and end date and priority have defaults). Therefore, it is easiest if you create a DataFrame that has similar data (i.e., a column of parent ID, child ID, start date, end date, priority). This package then has a function that allows you to create the bi-directional links required, `create_link_pair`: +```@docs +WRDSMerger.create_link_pair +``` + +Since this returns a tuple of dictionaries, each needs to be passed to `new_link_method` to create the bidirectional links. Then, to create links beyond just T1 <-> T2, call `create_all_links()`. + +## Other Functions + +```@docs +WRDSMerger.choose_best_match +WRDSMerger.check_priority_errors +WRDSMerger.is_higher_priority +WRDSMerger.identify_overlaps +WRDSMerger.value +WRDSMerger.all_pairs +``` \ No newline at end of file diff --git a/docs/src/misc_utilities.md b/docs/src/misc_utilities.md new file mode 100644 index 0000000..0997a37 --- /dev/null +++ b/docs/src/misc_utilities.md @@ -0,0 +1,7 @@ +# Utilities +```@docs +range_join +WRDSMerger.check_schema_perms +WRDSMerger.approx_row_count +WRDSMerger.modify_col! +``` diff --git a/src/WRDSMerger.jl b/src/WRDSMerger.jl index 53b67d0..c096a9f 100644 --- a/src/WRDSMerger.jl +++ b/src/WRDSMerger.jl @@ -7,16 +7,10 @@ module WRDSMerger ############################################################################## using DataFrames using Dates -using BusinessDays using Statistics using LibPQ using DBInterface -using AbstractTrees -using ShiftedArrays: lead using InteractiveUtils -using StatsBase -using Statistics -using LinearAlgebra ############################################################################## ## @@ -25,9 +19,13 @@ using LinearAlgebra ############################################################################## # identifiers and linking items -export link_identifiers, Permno, Cusip, NCusip, - GVKey, CIK, Ticker, IbesTicker, LinkTable, - link_table +export Permno, Permco, Cusip, NCusip, Cusip6, NCusip6, + GVKey, CIK, Ticker, IbesTicker, RPEntity, SecID, + FirmIdentifier, SecurityIdentifier, AbstractIdentifier, + LinkPair, AbstractLinkPair, create_all_links, + generate_ibes_links, generate_crsp_links, + generate_comp_cik_links, generate_option_crsp_links, + generate_comp_crsp_links, generate_ravenpack_links # downloads and WRDS exploration functions export comp_data, crsp_data, crsp_market, crsp_stocknames, @@ -35,7 +33,7 @@ export comp_data, crsp_data, crsp_market, crsp_stocknames, describe_table, get_table, raw_sql, ff_data # extra utilities -export range_join, BDay, Conditions +export range_join, Conditions ############################################################################## @@ -44,15 +42,17 @@ export range_join, BDay, Conditions ## ############################################################################## +include(joinpath("links", "identifierTypes.jl")) +include(joinpath("links", "linkPairs.jl")) +include(joinpath("links", "linkMethods.jl")) +include(joinpath("links", "creatingLinks.jl")) +include(joinpath("links", "downloadLinks.jl")) +include(joinpath("links", "specialCases.jl")) + include("utils.jl") -include(joinpath("utils", "dateFunctions.jl")) -include(joinpath("utils", "identifierTypes.jl")) -include(joinpath("utils", "linkTree.jl")) -include(joinpath("utils", "utils.jl")) include("crspFunctions.jl") include("compFunctions.jl") -include("mergeFunctions.jl") include("exploreDB.jl") include("ffData.jl") @@ -67,6 +67,8 @@ global default_tables = Dict{String, String}( "wrdsapps_ibcrsphist" => "wrdsapps.ibcrsphist", "comp_company" => "comp.company", "ff_factors" => "ff.factors_daily", + "optionm_all_secnmd" => "optionm_all.secnmd", + "ravenpack_common_rp_entity_mapping" => "ravenpack_common.rp_entity_mapping" ) end diff --git a/src/links/creatingLinks.jl b/src/links/creatingLinks.jl new file mode 100644 index 0000000..47767c8 --- /dev/null +++ b/src/links/creatingLinks.jl @@ -0,0 +1,485 @@ + +""" +This function looks for overlapping periods. It takes a list of all dates +and checks if individual sub periods are a subset of multiple periods. +""" +function identify_overlaps(dts1::AbstractVector, dts2::AbstractVector) + out = Set{Date}() + cur_dates = sort(vcat(dts1, dts2)) + for i in 1:length(cur_dates)-1 + c = 0 + for j in eachindex(dts1, dts2) + if cur_dates[i] >= dts1[j] && cur_dates[i+1] <= dts2[j] + c += 1 + end + end + if c ≥ 2 + push!(out, cur_dates[i]) + push!(out, cur_dates[i+1]) + end + end + out +end + +""" +This function tests whether there are any dates that are in multiple +`AbstractLinkPair`s and those links have equivalent priority. If this function +returns `true`, then there is at least a date where there is no distinction +between two links. The way [`choose_best_match`](@ref) works, the first in +the vector will be chosen. +""" +function check_priority_errors(data::AbstractVector{T}) where {T<:AbstractLinkPair} + if length(data) == 1 + return false + end + dates_to_check = identify_overlaps(min_date.(data), max_date.(data)) + for d in dates_to_check + possible = T[] + for v in data + if d in v + push!(possible, v) + end + end + best = 0 + for (i, v) in enumerate(possible) + # either first or the current one is higher priority + if best == 0 || is_higher_priority(possible[i], possible[best]) + best = i + end + end + for i in 1:length(possible) + if i == best + continue + end + if !(is_higher_priority(possible[best], possible[i])) && childID(possible[i]) != childID(possible[best]) + # println(possible) + return true + end + end + end + false +end + +""" + Dict(data::AbstractVector{L}) where {T1, T2, L<:AbstractLinkPair{T1, T2}} + +Converts a vector of `AbstractLinkPair`s to a dictionary where each T1 is a key +in the dictionary and the values are vectors of L. It also checks whether those +vectors ever have overlapping inconsistent priorities. +""" +function Base.Dict(data::AbstractVector{L}) where {T1, T2, L<:AbstractLinkPair{T1, T2}} + out = Dict{T1, Vector{L}}() + sizehint!(out, length(data)) + for v in data + if !haskey(out, parentID(v)) + out[parentID(v)] = Vector{L}() + end + push!(out[parentID(v)], v) + end + temp = check_priority_errors.(values(out)) + if any(temp) + @warn("There are $(sum(temp)) cases of overlapping identifiers linking " * + "$T1 -> $T2 that do not have a priority, links might be inconsistent") + end + out +end + +""" + function create_link_pair( + ::Type{LP}, + ::Type{T1}, + ::Type{T2}, + df::DataFrame, + cols... + ) where {T1<:AbstractIdentifier, T2<:AbstractIdentifier, LP<:AbstractLinkPair} + +Generic function that creates an AbstractLinkPair based on the types +and a DataFrame. `cols...` should be a list of column names in the DataFrame, +the first being ready to convert to type T1 and the second ready to convert +to type T2. This function returns a tuple of two dictionaries: +`(Dict{T1, LP{T1, T2}},Dict{T2, LP{T2, T1}})` +which is easily passed to [`new_link_method`](@ref). + +## Example +```julia +create_link_pair( + LinkPair, + Permno, + NCusip, + df, + :permno, + :ncusip, + :namedt, + :nameenddt, + :priority +) +``` +""" +function create_link_pair( + ::Type{LP}, + ::Type{T1}, + ::Type{T2}, + df::DataFrame, + cols... +) where {T1<:AbstractIdentifier, T2<:AbstractIdentifier, LP<:AbstractLinkPair} + df = select(df, cols...) |> unique + cols1 = [cols...] + cols2 = [cols[2], cols[1], cols[3:end]...] + dropmissing!(df, [cols[1], cols[2]]) + df[!, cols[1]] = T1.(df[:, cols[1]]) + df[!, cols[2]] = T2.(df[:, cols[2]]) + data1 = [LP(x...) for x in Tuple(eachrow(df[:, cols1]))] + data2 = [LP(x...) for x in Tuple(eachrow(df[:, cols2]))] + ( + Dict(data1), + Dict(data2) + ) +end + +""" + generate_ibes_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["wrdsapps_ibcrsphist"] + ) + + generate_ibes_links(df::AbstractDataFrame) + +Generates the methods between IbesTicker and Permno/NCusip based on a standard +WRDS file. If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. +""" +function generate_ibes_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["wrdsapps_ibcrsphist"] +) + df = download_ibes_links(conn; main_table) + generate_ibes_links(df) +end +function generate_ibes_links( + df_in::AbstractDataFrame +) + df = DataFrame(df_in) + df = dropmissing(df, [:permno, :ncusip]) + df[!, :priority] = 1 ./ df[:, :score] + temp = create_link_pair( + LinkPair, + IbesTicker, + Permno, + df, + :ticker, + :permno, + :sdate, + :edate, + :priority + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + temp = create_link_pair( + LinkPair, + IbesTicker, + Cusip, + df, + :ticker, + :ncusip, + :sdate, + :edate, + :priority + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + df_in +end + +""" + generate_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["crsp_stocknames"], + stockfile=default_tables["crsp_stock_data"] + ) + + generate_crsp_links(df::AbstractDataFrame) + +Generates the methods linking +Permno, Permco, Cusip, NCusip, Cusip6, NCusip6 and Ticker to each other. +If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. + +The file used (`crsp.stocknames`), does not have a clear way to differentiate +different priorities. The most common way is to calculate the market cap +of any conflicting securities to determine the best option. The ideal is the +market cap on the relevant day, but since this needs a static value, the +default download is to average the market cap over the relevant period. +""" +function generate_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["crsp_stocknames"], + stockfile=default_tables["crsp_stock_data"] +) + df = download_crsp_links(conn; main_table, stockfile) + generate_crsp_links(df) +end +function generate_crsp_links( + df_in::AbstractDataFrame; + priority_col=:mkt_cap +) + df = DataFrame(df_in) + df[!, :ncusip2] = df[:, :ncusip] + df[!, :cusip2] = df[:, :cusip] + ids = [ + (Permno, :permno), + (Permco, :permco), + (NCusip, :ncusip), + (NCusip6, :ncusip2), + (Ticker, :ticker), + (Cusip, :cusip), + (Cusip6, :cusip2) + ] + for (i, v1) in enumerate(ids) + for v2 in ids[i+1:end] + if v1[2] == v2[2] # for when the two values are equal + continue + end + + temp = create_link_pair( + LinkPair, + v1[1], + v2[1], + df, + v1[2], + v2[2], + :namedt, + :nameenddt, + priority_col + ) + if !( + (v1[1] == NCusip && v2[1] == NCusip6) + || (v1[1] == Cusip && v2[1] == Cusip6) + )# don't create links for NCusip -> NCusip6 or Cusip -> Cusip6 + # since there is a simpler definition + new_link_method(temp[1]) + end + new_link_method(temp[2]) + end + end + df_in +end + +""" + generate_comp_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["crsp_a_ccm_ccmxpf_lnkhist"] + ) + + generate_comp_crsp_links(df::AbstractDataFrame) + +Generates the methods linking GVKey and Permno/Permco based on +the CRSP/Compustat merged annual file link history +(`crsp_a_ccm.ccmxpf_lnkhist`). +If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. +""" +function generate_comp_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["crsp_a_ccm_ccmxpf_lnkhist"] +) + df = download_comp_crsp_links(conn; main_table) + generate_comp_crsp_links(df) +end +function generate_comp_crsp_links( + df_in::AbstractDataFrame +) + df = DataFrame(df_in) + for i in 1:nrow(df) + # the notes specifically point out that if the linktype is + # "LS", then the gvkey - permco link is not valid, so this + # specifies that + allowmissing!(df, :lpermco) + if df[i, :linktype] == "LS" + df[i, :lpermco] = missing + end + end + ids = [ + (Permco, :lpermco), + (Permno, :lpermno), + ] + for v in ids + temp = create_link_pair( + LinkPair, + GVKey, + v[1], + df, + :gvkey, + v[2], + :linkdt, + :linkenddt, + :linkprim, + :linktype + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + end + df_in +end + +""" + generate_comp_cik_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["comp_company"] + ) + + generate_comp_cik_links(df::AbstractDataFrame) + +Generates the methods linking GVKey and CIK based on +the Compustat company name file (`comp.company`). GVKey and CIK do not have +any date conditions, so this download is relatively simple. +If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. +""" +function generate_comp_cik_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["comp_company"] +) + df = download_comp_cik_links(conn; main_table) + generate_comp_cik_links(df) +end +function generate_comp_cik_links( + df_in::AbstractDataFrame +) + df = DataFrame(df_in) + temp = create_link_pair( + LinkPair, + GVKey, + CIK, + df, + :gvkey, + :cik + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + df_in +end + +function prev_value(x::AbstractVector{T}) where {T} + out = Vector{Union{Missing, T}}(missing, length(x)) + for i in 1:length(x)-1 + out[i] = x[i+1] - Day(1) + end + out +end + +""" + generate_option_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["optionm_all_secnmd"] + ) + + generate_option_crsp_links(df::AbstractDataFrame) + +Generates the methods linking SecID and NCusip based on +the option names file (`optionm_all.secnmd`). This file only provides an +"effective date", so it is assumed that once the next "effective date" +occurs, the link is no longer valid. +If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. +""" +function generate_option_crsp_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["optionm_all_secnmd"] +) + df = download_option_crsp_links(conn; main_table) + generate_option_crsp_links(df) +end +function generate_option_crsp_links( + df_in::AbstractDataFrame +) + df = DataFrame(df_in) + for i in 1:nrow(df) + allowmissing!(df, :cusip) + if df[i, :cusip] == "99999999" + df[i, :cusip] = missing + end + end + df[!, :effect_date] = Date.(df[:, :effect_date]) + sort!(df, [:secid, :effect_date]) + df = transform(groupby(df, :secid), :effect_date => prev_value => :end_date) + temp = create_link_pair( + LinkPair, + SecID, + NCusip, + df, + :secid, + :cusip, + :effect_date, + :end_date + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + df_in +end + + +function adjust_next_day(s, e) + for i in 1:length(e)-1 + # if e[i] |> ismissing + # e[i] = s[i+1] - Day(1) + if !ismissing(e[i]) && s[i+1] == e[i] + e[i] = e[i] - Day(1) + end + end + e +end + +""" + generate_ravenpack_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["ravenpack_common_rp_entity_mapping"] + ) + + generate_ravenpack_links(df::AbstractDataFrame) + +Generates the methods linking RPEntity and NCusip6 based on +the RavenPack Entity Mapping file (`ravenpack_common.rp_entity_mapping`). +This file is very messy, so the automatic options make several assumptions +and filters. First, when downloading the data, it filters any NCusip in the +RavenPack file that is not in the `crsp.stocknames` file. Second, for each +RPEntity, if the end date is missing, it assumes the next start date is +the appropriate end date for the link. +If a database connection is provided, then it will download +the table, otherwise, it can use a provided DataFrame. +""" +function generate_ravenpack_links( + conn::Union{LibPQ.Connection, DBInterface.Connection}; + main_table=default_tables["ravenpack_common_rp_entity_mapping"] +) + df = download_ravenpack_links(conn; main_table) + generate_ravenpack_links(df) +end +function generate_ravenpack_links( + df_in::AbstractDataFrame +) + df = DataFrame(df_in) + df = sort(df, [:rp_entity_id, :range_start]) + df[!, :range_start] = Date.(df[:, :range_start]) + df = transform(groupby(df, :rp_entity_id), [:range_start, :range_end] => (x, y) -> adjust_next_day(x, y) => :range_end) + temp = create_link_pair( + LinkPair, + RPEntity, + NCusip6, + df, + :rp_entity_id, + :ncusip, + :range_start, + :range_end + ) + new_link_method(temp[1]) + new_link_method(temp[2]) + df_in +end + +function create_all_links() + needed_links=all_pairs(AbstractIdentifier, AbstractIdentifier; test_fun=method_is_missing) + base_links=all_pairs(AbstractIdentifier, AbstractIdentifier) + for l in needed_links + new_link_method(l...; current_links=base_links) + end +end \ No newline at end of file diff --git a/src/links/downloadLinks.jl b/src/links/downloadLinks.jl new file mode 100644 index 0000000..e8644e0 --- /dev/null +++ b/src/links/downloadLinks.jl @@ -0,0 +1,138 @@ + +""" + download_crsp_links(db; main_table="crsp.stocknames", stockfile="crsp.dsf") + +Runs the following SQL code (tables are changeable by setting +the `main_table` and `stockfile` keyword arguments): +```sql +select a.*, b.mkt_cap from crsp.stocknames a + left join ( + select s.permno, s.namedt, s.nameenddt, avg(d.mkt_cap) as mkt_cap from crsp.stocknames s + inner join (select permno, date, abs(prc) * shrout as mkt_cap from crsp.dsf) as d + on s.permno = d.permno and s.namedt <= d.date and s.nameenddt >= d.date + group by s.permno, s.namedt, s.nameenddt + ) b + on a.permno = b.permno and a.namedt = b.namedt and a.nameenddt = b.nameenddt +``` +and returns a DataFrame. +""" +function download_crsp_links(db; main_table="crsp.stocknames", stockfile="crsp.dsf") + q = """ + select a.*, b.mkt_cap from $main_table a + left join ( + select s.permno, s.namedt, s.nameenddt, avg(d.mkt_cap) as mkt_cap from $main_table s + inner join (select permno, date, abs(prc) * shrout as mkt_cap from $stockfile) as d + on s.permno = d.permno and s.namedt <= d.date and s.nameenddt >= d.date + group by s.permno, s.namedt, s.nameenddt + ) b + on a.permno = b.permno and a.namedt = b.namedt and a.nameenddt = b.nameenddt + """ + df = raw_sql(db, q) + df[!, :mkt_cap] = coalesce.(df[:, :mkt_cap], 0.0) + df +end + +""" + download_comp_crsp_links(db; main_table="crsp_a_ccm.ccmxpf_linkhist") + +Runs the following SQL code (table is changeable by setting the `main_table` keyword argument): +```sql +SELECT * FROM crsp_a_ccm.ccmxpf_linkhist +``` +and returns the resulting DataFrame +""" +function download_comp_crsp_links(db; main_table="crsp_a_ccm.ccmxpf_linkhist") + q = "SELECT * FROM $main_table" + raw_sql(db, q) +end + +""" + download_comp_cik_links(db; main_table="comp.company") + +Runs the following SQL code (table is changeable by setting the `main_table` keyword argument): +```sql +SELECT * FROM comp.company +``` +and returns the resulting DataFrame +""" +function download_comp_cik_links(db; main_table="comp.company") + q = "SELECT * FROM $main_table" + raw_sql(db, q) +end + +""" + download_ibes_links(db; main_table="wrdsapps.ibcrsphist") + +Runs the following SQL code (table is changeable by setting the `main_table` keyword argument): +```sql +SELECT * FROM wrdsapps.ibcrsphist +``` +and returns the resulting DataFrame +""" +function download_ibes_links(db; main_table="wrdsapps.ibcrsphist") + q = "SELECT * FROM $main_table" + raw_sql(db, q) +end + +""" + download_option_crsp_links(db; main_table="optionm_all.secnmd") + +Runs the following SQL code (table is changeable by setting the `main_table` keyword argument): +```sql +SELECT * FROM optionm_all.secnmd +``` +and returns the resulting DataFrame +""" +function download_option_crsp_links(db; main_table="optionm_all.secnmd") + q = "SELECT * FROM $main_table" + raw_sql(db, q) +end + +""" + download_ravenpack_links(db; main_table="ravenpack.rp_entity_mapping", cusip_list="crsp.stocknames") + +Runs the following SQL code (tables are changeable by setting +the `main_table` and `cusip_list` keyword arguments): +```sql +SELECT rp_entity_id, data_value as ncusip, range_start, range_end FROM ravenpack.rp_entity_mapping as a + inner join (select distinct ncusip from crsp.stocknames) as b + on left(a.data_value, 8) = b.ncusip +``` +and returns a DataFrame. +""" +function download_ravenpack_links(db; main_table="ravenpack.rp_entity_mapping", cusip_list="crsp.stocknames") + q = """ + SELECT rp_entity_id, data_value as ncusip, range_start, range_end FROM $main_table as a + inner join (select distinct ncusip from $cusip_list) as b + on left(a.data_value, 8) = b.ncusip + """ + raw_sql(db, q) +end + +function download_all_links( + db; + funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, + generate_ibes_links, + generate_option_crsp_links, + generate_ravenpack_links + ], + save_dfs=true +) + out_dfs = DataFrame[] + for f in funs + df = f(db) + if save_dfs + push!(out_dfs, df) + end + end + create_all_links() + if save_dfs + out_dfs + else + println("Downloaded $(length(funs)) files and created relevant methods") + end +end + diff --git a/src/links/identifierTypes.jl b/src/links/identifierTypes.jl new file mode 100644 index 0000000..a80e1b9 --- /dev/null +++ b/src/links/identifierTypes.jl @@ -0,0 +1,678 @@ +""" +Supertype for all Firm Identifiers +""" +abstract type AbstractIdentifier end + +""" +A `FirmIdentifier` specifies a specific firm over a given date range and +is opposed to a [`SecurityIdentifier`](@ref). In a standard database, a single +`FirmIdentifier` can have multiple `SecurityIdentifier`s but a +`SecurityIdentifier` should only have one `FirmIdentifier`. + +Examples include [`GVKey`](@ref), [`Permco`](@ref) and [`Cusip6`](@ref). +""" +abstract type FirmIdentifier <: AbstractIdentifier end + +""" +A `SecurityIdentifier` specifies a specific firm over a given date range and +is opposed to a [`FirmIdentifier`](@ref). In a standard database, a single +`FirmIdentifier` can have multiple `SecurityIdentifier`s but a +`SecurityIdentifier` should only have one `FirmIdentifier`. + +Examples include [`Permno`](@ref), [`Cusip`](@ref) and [`Ticker`](@ref). +""" +abstract type SecurityIdentifier <: AbstractIdentifier end + +# checksum calculator for Cusip +function luhn_checksum(s) + if length(s) != 8 + error("Length must be 8 digits") + end + tot = 0 + for (i, v) in enumerate(s) + n = if '0' ≤ v ≤ '9' + parse(Int, v) + elseif 'A' ≤ v ≤ 'Z' + Int(v) - 65 + 10 + elseif 'a' ≤ v ≤ 'z' + Int(v) - 97 + 10 + elseif v == '*' + 36 + elseif v == '@' + 37 + elseif v == '#' + 38 + end + if iseven(i) + n *= 2 + end + tot += floor(n / 10) + n % 10 + end + (10 - tot % 10) % 10 |> Int +end + + +""" + 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 + +```jldoctest +julia> GVKey(2968) # GVKey for Chase +GVKey("002968") + +julia> GVKey("002968") +GVKey("002968") + +julia> GVKey(Permno(47896), Date(2020)) +"002968" +``` +""" +struct GVKey <: FirmIdentifier + val::String + function GVKey(s::AbstractString) + if length(s) > 6 + error("GVKey can only have 6 digits") + end + new(lpad(String(s), 6, "0")) + end +end + +function GVKey(n::Real) + if n > 999999 + error("GVKey can only have 6 digits") + end + GVKey(lpad(n, 6, "0")) +end + +value(n::GVKey) = n.val + + + +""" + 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 +```jldoctest +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" +``` +""" +struct CIK <: FirmIdentifier + val::String + function CIK(s::AbstractString) + if length(s) > 10 + error("CIK can only have 10 digits") + end + new(lpad(String(s), 10, "0")) + end +end + +function CIK(n::Real) + if n > 9_999_999 + error("CIK can only have 10 digits") + end + CIK(lpad(n, 10, "0")) +end + +value(n::CIK) = n.val + + + +""" + Cusip6 <: FirmIdentifier + + Cusip6(s::AbstractString)::Cusip6 + + Cusip6(x::Cusip)::Cusip6 + + Cusip6(x::AbstractIdentifier, d::Date)::String + +Cusip6 is the firm identifier component of [`Cusip`](@ref). It +can contain numbers or letters (with a maximum length of 6 +characters). + +!!! note + `Cusip6` is different than [`NCusip6`](@ref). The standard in + CRSP (and some other WRDS datasets) is that `Cusip6` represents + the most recently available `NCusip6` for a given firm, while + `NCusip6` will provide a historical view of that firm. + +## Example + +```jldoctest +julia> Cusip6("46625H") # Cusip6 for Chase +Cusip6("46625H") + +julia> Cusip6(Cusip("46625H10")) # Cusip6 is the first 6 digits of a Cusip +Cusip6("46625H") + +julia> Cusip6(Permno(47896), Date(2020)) +"46625H" +``` + +Related to the note on the difference between `Cusip6` and `NCusip6`: +```jldoctest +julia> Cusip6(Permno(47896), Date(2020)) +"46625H" + +julia> NCusip6(Permno(47896), Date(2020)) +"46625H" + +julia> Cusip6(Permno(47896), Date(1998)) +"46625H" + +julia> NCusip6(Permno(47896), Date(1998)) +"16161A" +``` +""" +struct Cusip6 <: FirmIdentifier + val::String + function Cusip6(s::AbstractString) + if length(s) < 6 + error("Cusip6 must be 6 characters") + end + new(String(s[1:6])) + end +end + +value(n::Cusip6) = n.val + +""" + NCusip6 <: FirmIdentifier + + NCusip6(s::AbstractString)::NCusip6 + + NCusip6(x::NCusip)::NCusip6 + + NCusip6(x::AbstractIdentifier, d::Date)::String + +NCusip6 is the firm identifier component of [`NCusip`](@ref). It +can contain numbers or letters (with a maximum length of 6 +characters). + +!!! note + `NCusip6` is different than [`Cusip6`](@ref). The standard in + CRSP (and some other WRDS datasets) is that `Cusip6` represents + the most recently available `NCusip6` for a given firm, while + `NCusip6` will provide a historical view of that firm. + +## Example + +```jldoctest +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`: +```jldoctest +julia> Cusip6(Permno(47896), Date(2020)) +"46625H" + +julia> NCusip6(Permno(47896), Date(2020)) +"46625H" + +julia> Cusip6(Permno(47896), Date(1998)) +"46625H" + +julia> NCusip6(Permno(47896), Date(1998)) +"16161A" +``` +""" +struct NCusip6 <: FirmIdentifier + val::String + function NCusip6(s::AbstractString) + if length(s) < 6 + error("Cusip6 must be 6 characters") + end + new(String(s[1:6])) + end +end + +value(n::NCusip6) = n.val + + +""" + 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 `Cusip`s as [`NCusip`](@ref) +all `Cusip`s 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 different than [`NCusip`](@ref). The standard in + CRSP (and some other WRDS datasets) is that `Cusip` represents + the most recently available `NCusip` for a given firm, while + `NCusip` will provide a historical view of that firm. + +!!! 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 + +```jldoctest +julia> Cusip("46625H10") # Cusip for Chase +Cusip("46625H10") + +julia> Cusip("46625H", "10") # can also provide the parts separately +Cusip("46625H10") + +julia> Cusip(Permno(47896), Date(2020)) +"46625H10" +``` + +Related to the note on the difference between `Cusip` and `NCusip`: +```jldoctest +julia> Cusip(Permno(47896), Date(2020)) +"46625H10" + +julia> NCusip(Permno(47896), Date(2020)) +"46625H10" + +julia> Cusip(Permno(47896), Date(1998)) +"46625H10" + +julia> NCusip(Permno(47896), Date(1998)) +"16161A10" +``` +""" +struct Cusip <: SecurityIdentifier + val::String + function Cusip(s::AbstractString) + if length(s) < 8 + error("Too few characters for Cusip") + end + if length(s) > 9 + error("Too many characters for Cusip") + end + if length(s) == 9 && luhn_checksum(s[1:8]) != parse(Int, s[9]) + @warn("Invalid Checksum in parsing Cusip, this observation " * + "might not match other Cusips. To correct this error, pass " * + "the first 8 characters of the string instead.") + end + new(s[1:8]) + end +end + +function Cusip(issuer::AbstractString, issue::AbstractString, checksum=nothing) + if length(issuer) != 6 + error("Issuer identification must be 6 characters") + end + if length(issue) != 2 + error("Issue must be 2 characters") + end + if checksum !== nothing && (!)(0 ≤ checksum ≤ 9) + error("Checksum must be between 0 and 9 (inclusive)") + elseif checksum !== nothing && luhn_checksum(issuer * issue) != checksum + @warn("Invalid Checksum in parsing Cusip") + end + Cusip(issuer * issue) +end + + +function value(n::Cusip, l::Int=8) + out = n.val + if l == 9 + out * string(luhn_checksum(n.val)) + else + out + end +end + +""" + NCusip <: SecurityIdentifier + + NCusip(s::AbstractString)::NCusip + + NCusip(issuer::AbstractString, issue::AbstractString, checksum=nothing)::NCusip + + NCusip(x::AbstractIdentifier, d::Date)::String + +`NCusip` is a common identifier within and outside of WRDS +WRDS tracks the most recent `NCusip`s as [`Cusip`](@ref) +all `NCusip`s 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 + `NCusip` is different than [`Cusip`](@ref). The standard in + CRSP (and some other WRDS datasets) is that `Cusip` represents + the most recently available `NCusip` for a given firm, while + `NCusip` will provide a historical view of that firm. + +!!! 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 + +```jldoctest +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`: +```jldoctest +julia> Cusip(Permno(47896), Date(2020)) +"46625H10" + +julia> NCusip(Permno(47896), Date(2020)) +"46625H10" + +julia> Cusip(Permno(47896), Date(1998)) +"46625H10" + +julia> NCusip(Permno(47896), Date(1998)) +"16161A10" +``` +""" +struct NCusip <: SecurityIdentifier + val::String + function NCusip(s::AbstractString) + if length(s) < 8 + error("Too few characters for NCusip") + end + if length(s) > 9 + error("Too many characters for NCusip") + end + if length(s) == 9 && luhn_checksum(s[1:8]) != parse(Int, s[9]) + @warn("Invalid Checksum in parsing NCusip, this observation " * + "might not match other NCusips. To correct this error, pass " * + "the first 8 characters of the string instead.") + end + new(s[1:8]) + end +end + +function NCusip(issuer::AbstractString, issue::AbstractString, checksum=nothing) + if length(issuer) != 6 + error("Issuer identification must be 6 characters") + end + if length(issue) != 2 + error("Issue must be 2 characters") + end + if checksum !== nothing && (!)(0 ≤ checksum ≤ 9) + error("Checksum must be between 0 and 9 (inclusive)") + elseif checksum !== nothing && luhn_checksum(issuer * issue) != checksum + @warn("Invalid Checksum in parsing NCusip") + end + NCusip(issuer * issue) +end + + +function value(n::NCusip, l::Int=8) + out = n.val + if l == 9 + out * string(luhn_checksum(n.val)) + else + out + end +end + +Cusip6(x::Cusip) = Cusip6(value(x)[1:6]) +NCusip6(x::NCusip) = NCusip6(value(x)[1:6]) + + + +""" + 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`](@ref). `IbesTicker` + is within the IBES database and often differs from `Ticker`. + +## Example + +```jldoctest +julia> Ticker("JPM") # Ticker for Chase +Ticker("JPM") + +julia> Ticker(Permno(47896), Date(2020)) +"JPM" +``` +""" +struct Ticker <: SecurityIdentifier + val::String + function Ticker(s::Union{AbstractString, Symbol}) + new(String(s)) + end +end + +value(n::Ticker) = n.val + + +""" + 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 + +```jldoctest +julia> IbesTicker("CHL") # IbesTicker for Chase +IbesTicker("CHL") + +julia> IbesTicker(Permno(47896), Date(2020)) +"CHL" +``` +""" +struct IbesTicker <: SecurityIdentifier + val::String + function IbesTicker(s::Union{AbstractString, Symbol}) + new(String(s)) + end +end + +value(n::IbesTicker) = n.val + + +""" + 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`](@ref) and Compustat ([`GVKey`](@ref)), and Cusip. + +## Example + +```jldoctest +julia> Permno(47896) # Permno for Chase +Permno(47896) + +julia> Permno(NCusip6("46625H"), Date(2020)) +47896 +``` +""" +struct Permno <: SecurityIdentifier + val::Int + Permno(x::Real) = new(Int(x)) +end + +value(n::Permno) = n.val + +""" + Permco <: FirmIdentifier + + Permco(x::Real)::Permco + + Permco(x::AbstractIdentifier, d::Date)::Int + +Permco is the primary firm identifier in the CRSP universe. + +## Example + +```jldoctest +julia> Permco(20436) # Permco for Chase +Permco(20436) + +julia> Permco(NCusip6("46625H"), Date(2020)) +20436 +``` +""" +struct Permco <: FirmIdentifier + val::Int + Permco(x::Real) = new(Int(x)) +end + +value(n::Permco) = n.val + +""" + RPEntity <: FirmIdentifier + + RPEntity(x::String)::RPEntity + + RPEntity(x::AbstractIdentifier, d::Date)::String + +RPEntity is used within RavenPack to identify different entities. + +## Example + +```jldoctest +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 + +```jldoctest +julia> RPEntity(NCusip6("46625H"), Date(2001, 3)) +"619882" + +julia> RPEntity(NCusip6("616880"), Date(2001, 3)) +"619882" + +julia> NCusip6(RPEntity("619882"), Date(2001, 3)) +"46625H" +``` +""" +struct RPEntity <: FirmIdentifier + val::String + function RPEntity(s::AbstractString) + new(String(s)) + end +end + +value(n::RPEntity) = n.val + +""" + SecID <: SecurityIdentifier + + SecID(x::Real)::SecID + + SecID(x::AbstractIdentifier, d::Date)::Int + +SecID is the primary identifier within the OptionMetrics database. + +```jldoctest +julia> SecID(102936) # SecID for Chase +SecID(102936) + +julia> SecID(NCusip("46625H10"), Date(2020)) +102936 +``` +""" +struct SecID <: SecurityIdentifier + val::Int + SecID(x::Real) = new(Int(x)) +end + +value(n::SecID) = n.val + + + +(::Type{ID})(x::Missing) where {ID <: AbstractIdentifier} = x +(::Type{ID})(x::ID) where {ID <: AbstractIdentifier} = x + +""" + value(x::AbstractIdentifier) + +Converts an identifier into a common Julia type (typically `Int` or `String`). +""" +value(x::Missing) = x + +# Base.show(io::IOContext, id::AbstractIdentifier) = show(io, value(id)) +# Base.print(io::IO, id::AbstractIdentifier) = print(io, value(id)) + diff --git a/src/links/linkMethods.jl b/src/links/linkMethods.jl new file mode 100644 index 0000000..0ada5a1 --- /dev/null +++ b/src/links/linkMethods.jl @@ -0,0 +1,351 @@ + +""" + convert_identifier(::Type{ID}, x::T1, dt::Date; vargs...) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + + convert_identifier( + ::Type{ID}, + x::T1, + dt::Date, + data::Dict{T1, Vector{<:AbstractLinkPair{T1, ID}}}=data; + vargs... + ) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + +Converts an identifier (T1) to a different identifier (ID). In its most generic +form, this throws a `MethodError` implying there is not a function that exists +to directly link T1 -> ID. + +Calling [`new_link_method`](@ref) calls a macro to +create different versions of `convert_identifier` to provide links +between identifiers. If these are direct links (which means there is a +`AbstractLinkPair` that links the two identifiers, such as Permno -> Permco +or Permno -> NCusip), then this provides a one step method to link these +two identifiers. + +For other identifiers, there is not a link table that +provides a direct link (such as SecID -> GVKey). In those cases, +`new_link_method` will find a path between the two (in the case of SecID -> GVKey, +SecID -> NCusip -> Permno -> GVKey). Each case of `convert_identifier` only +does 1 step in the process, so `convert_identifier(GVKey, SecID(1), today())` +would call `convert_identifier(Permno, SecID(1), today())`. + +!!! note + There are two slightly different behaviors for the direct links of + `convert_identifier`. When linking a `SecurityIdentifier` -> `FirmIdentifier`, + the function might retry if a link is not found with the parent identifier + of the security. For example, when trying to link NCusip -> GVKey, the + default behavior is to try NCusip -> Permno -> GVKey. However, suppose + there is not a matching NCusip -> Permno, the function will try again + with NCusip6 -> Permno. The logic is that it should not matter if + the Permno does not perfectly match the NCusip if the end goal is + to find a relevant GVKey. This behavior can be disabled by using + `allow_parent_firm=false`. +""" +function convert_identifier(::Type{ID}, x::T1, dt::Date; vargs...) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + throw( + MethodError, + "No Method currently links $T1 -> $ID. Make sure the proper data " * + "is loaded and run `create_all_links()` to create the necessary methods." + ) +end + +function convert_identifier(::Type{ID}, ::Missing, dt::Date; vargs...) where {ID<:AbstractIdentifier} + missing +end + + +""" + new_link_method(data::Vector{L}) where {L<:AbstractLinkPair} + + new_link_method(data::Dict{T1, Vector{L}}) where {T1, ID, L<:AbstractLinkPair{T1, ID}} + + function new_link_method( + ::Type{T1}, + ::Type{ID}; + current_links = all_pairs(AbstractIdentifier, AbstractIdentifier) + ) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + +Creates a new [`convert_identifier`](@ref) method to link T1 -> ID. See detailed +notes under `convert_identifier`. If a vector of `AbstractLinkPair` or a dictionary +is passed, this creates a direct link method, while passing two types +will attempt to find a path between the two identifiers and define the appropriate +function. + +!!! note + [`all_pairs`](@ref) is a relatively slow function, needing to repeatedly + check what methods are available. Therefore, if needing to create many new + methods, it is best to run `all_pairs` once and pass that for each new + T1 -> ID that needs to be created. +""" +function new_link_method(data::Vector{L}) where {L<:AbstractLinkPair} + new_link_method(Dict(data)) +end +function new_link_method(data::Dict{T1, Vector{L}}) where {T1, ID, L<:AbstractLinkPair{T1, ID}} + if WRDSMerger.has_parent(T1) + @eval begin + function convert_identifier( + ::Type{$ID}, + x::$T1, + dt::Date, + data::Dict{$T1, Vector{$L}}=$data; + allow_parent_firm=false, + vargs... + ) + if haskey(data, x) + WRDSMerger.choose_best_match(data[x], dt; vargs...) + elseif allow_parent_firm && has_parent($T1) && parent_type($T1) != $ID + convert_identifier($ID, convert_identifier(parent_type($T1), x, dt), dt) + else + missing + end + end + end + else + @eval begin + function convert_identifier( + ::Type{$ID}, + x::$T1, + dt::Date, + data::Dict{$T1, Vector{$L}}=$data; + vargs... + ) + if haskey(data, x) + WRDSMerger.choose_best_match(data[x], dt; vargs...) + else + missing + end + end + end + end +end + +function new_link_method( + ::Type{T1}, + ::Type{ID}; + current_links = all_pairs(AbstractIdentifier, AbstractIdentifier) +) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + f = get_steps(T1, ID; current_links) + if f === nothing # there is not the necessary link data + return nothing + end + @assert length(f) > 2 "Error in number of steps" + @assert f[end] == ID "Failed to find path" + inter_step = f[end-1] + @eval begin + function convert_identifier(::Type{$ID}, x::$T1, dt::Date; vargs...) + convert_identifier( + $ID, + convert_identifier($inter_step, x, dt; vargs...), + dt + ) + end + end + println("Created link for $T1 -> $ID") +end + +function base_method_exists(x, y) + !isempty(methods(convert_identifier, (Type{y}, x, Date, Dict))) +end +function method_is_missing(x, y) + isempty( + intersect( + methodswith(Type{y}, convert_identifier), + methodswith(x, convert_identifier) + ) + ) +end + +""" + function all_pairs( + a::Type{<:AbstractIdentifier}, + b::Type{<:AbstractIdentifier}; + out = Vector{Tuple{DataType, DataType}}(), + test_fun=base_method_exists + ) + +Generates a vector of tuples for which a method exists. It specifically looks +for base types (not abstract types). + +`test_fun` has two values defined: +- `base_method_exists` looks for methods that have the two types provided + and that link is a direct link (e.g., Permno <-> NCusip), as opposed to a + method that takes more than a single step +- `method_is_missing` looks for methods that do not exist, this is designed to + look for cases where a new method is needed, typically taking more than a + single step to complete +""" +function all_pairs( + a::Type{<:AbstractIdentifier}, + b::Type{<:AbstractIdentifier}; + out = Vector{Tuple{DataType, DataType}}(), + test_fun=base_method_exists +) + for x in subtypes(a) + if isabstracttype(x) + out = all_pairs(x, b; out, test_fun) + end + for y in subtypes(b) + if x == y || isabstracttype(x) + continue + end + if isabstracttype(y) + out = all_pairs(a, y; out, test_fun) + elseif test_fun(x, y) + push!(out, (x, y)) + end + end + end + out |> unique +end + +function new_links(link, current_links) + out = Vector{Vector{DataType}}() + for l in current_links + if link[end] == l[1] && l[2] ∉ link + push!(out, vcat(link, [l[2]])) + end + end + out +end +function find_path(links, current_links, T) + out = Vector{Vector{DataType}}() + for link in links + temp = new_links(link, current_links) + out = vcat(out, temp) + end + if length(out) == 0 + return nothing + elseif any(last.(out) .== T) + for x in out + if last(x) == T && Permno ∈ x # Permno tends to be a much better match, so prefer + # that over other potential paths + # (e.g., gvkey -> permno -> cusip instead of gvkey -> permco -> cusip) + return x + end + end + + return out[findfirst(last.(out) .== T)] + else + return find_path(out, current_links, T) + end +end + + +function get_steps( + ::Type{T1}, + ::Type{T2}; + current_links = all_pairs(AbstractIdentifier, AbstractIdentifier) +) where {T1, T2} + links = new_links([T1], current_links) + find_path(links, current_links, T2) +end + +has_parent(::Type{<:AbstractIdentifier}) = false +has_parent(::Type{Cusip}) = true +has_parent(::Type{NCusip}) = true +parent_type(::Type{Cusip}) = Cusip6 +parent_type(::Type{NCusip}) = NCusip6 + +function all_same_child(data::AbstractVector{L}) where {L<:AbstractLinkPair} + if length(data) == 1 + return true + end + val1 = childID(data[1]) + for v in childID.(data[2:end]) + if val1 != v + return false + end + end + true +end +""" + function choose_best_match( + data::AbstractVector{L}, + dt::Date; + allow_inexact_date=true, + args... + ) where {L<:AbstractLinkPair} + +Picks the best identifier based on the vector of links provided. + +## Args + +- `allow_inexact_date=true`: If true, and the length of the supplied vector is 1, then is will return that + value even if the supplied date does not fit within the link. + +""" +function choose_best_match( + data::AbstractVector{L}, + dt::Date; + allow_inexact_date=true, + args... +) where {L<:AbstractLinkPair} + best = 0 + for (i, v) in enumerate(data) + if dt in v + # either first or the current one is higher priority + if best == 0 || is_higher_priority(data[i], data[best], dt, args...) + best = i + end + end + end + if best != 0 + childID(data[best]) + elseif allow_inexact_date && (all_same_child(data)) + # no matches with date, but there is only one link + childID(data[1]) + else + missing + end +end + + +# in the most generic version, allow flexible dates but not flexible firms since this is either +# a firm -> firm, firm -> security, or security -> security +function (::Type{ID})( + x::T1, + dt::Date; + allow_inexact_date=true, + allow_parent_firm=false, +) where {ID<:AbstractIdentifier, T1<:AbstractIdentifier} + out = convert_identifier(ID, x, dt; allow_inexact_date, allow_parent_firm) + value(out) +end + +# A special version where if trying to link a security -> a firm, then allow a link to +# a parent firm earlier. For example, a Cusip might have no direct link to a Permno +# (which would then connect to a GVKey), but the Cusip6 does link to a Permno +# so use that value instead +function (::Type{ID})( + x::T1, + dt::Date; + allow_inexact_date=true, + allow_parent_firm=true, +) where {ID<:FirmIdentifier, T1<:SecurityIdentifier} + out = convert_identifier(ID, x, dt; allow_inexact_date, allow_parent_firm) + value(out) +end + + +# the current design is pretty fast, so the extra benefit of +# using threads is pretty small +# function (::Type{ID})( +# x::AbstractVector{T}, +# dt::AbstractVector{Date}; +# vargs... +# ) where {ID <: AbstractIdentifier, T<:Union{Missing, AbstractIdentifier}} +# out = Vector{Union{Missing, String}}(missing, length(x)) +# Threads.@threads for i in eachindex(x, dt) +# out[i] = ID(x[i], dt[i]; vargs...) +# end +# out +# end + + +function (::Type{ID})( + x::Missing, + dt::Date; + vargs... +) where {ID <: AbstractIdentifier} + missing +end + diff --git a/src/links/linkPairs.jl b/src/links/linkPairs.jl new file mode 100644 index 0000000..b5ee7e8 --- /dev/null +++ b/src/links/linkPairs.jl @@ -0,0 +1,185 @@ + +abstract type AbstractLinkPair{T1<:AbstractIdentifier, T2<:AbstractIdentifier} end + +function Base.show(io::IO, x::AbstractLinkPair{T1, T2}) where {T1, T2} + show(io, "$T1($(parentID(x))) -> $T2($(childID(x))) valid $(min_date(x)) - $(max_date(x)) with priority $(round(priority(x), digits=3))") +end + +function Base.print(io::IO, x::AbstractLinkPair{T1, T2}) where {T1, T2} + print(io, "$T1($(parentID(x))) -> $T2($(childID(x))) valid $(min_date(x)) - $(max_date(x)) with priority $(round(priority(x), digits=3))") +end + + + +parentID(data::AbstractLinkPair) = data.parent +childID(data::AbstractLinkPair) = data.child +min_date(data::AbstractLinkPair) = data.dt1 +max_date(data::AbstractLinkPair) = data.dt2 +priority(data::AbstractLinkPair, args...) = data.priority + +Base.in(dt::Date, link::AbstractLinkPair) = min_date(link) <= dt <= max_date(link) + +""" + is_higher_priority( + data1::AbstractLinkPair{T1, T2}, + data2::AbstractLinkPair{T1, T2}, + args... + ) where {T1, T2} + +Determines whether data1 has higher priority than data2. `args...` are +automatically passed to the `priority`function, which can then deal +with special circumstances (currently passed as the date of the match). +However, none of the default settings use this. +""" +function is_higher_priority( + data1::AbstractLinkPair{T1, T2}, + data2::AbstractLinkPair{T1, T2}, + args... +) where {T1, T2} + priority(data1, args...) > priority(data2, args...) +end + + + +""" + function LinkPair( + parent::T1, + child::T2, + dt1::Union{Missing, Date, String}=Date(0, 1, 1), + dt2::Union{Missing, Date, String}=Date(9999, 12, 31), + priority::Real=0.0 + ) where {T1<:AbstractIdentifier, T2<:AbstractIdentifier} + + function LinkPair( + parent::T1, + child::T2, + dt1::Union{Missing, Date, String}, + dt2::Union{Missing, Date, String}, + linkprim::String, + linktype::String, + ) where {T1<:Union{GVKey, Permno, Permco}, T2<:Union{GVKey, Permno, Permco}} + +`LinkPair` is the basic structure that provides a link between two identifiers. +These are defined as a single direction link (T1 -> T2) that is valid between +a specific date range (inclusive) and has a given priority (higher is better). +Priority is useful if there are overlapping T1 -> T2 items. For example, a +[`FirmIdentifier`](@ref) likely has multiple [`SecurityIdentifier`](@ref)s +that relate to it. One common way to pick between different `SecurityIdentifier`s +is to pick the one with the large market cap as the primary. + +If defining a new identifier that has other methods of choosing priorities +(such as a String indicating priority), it can help to define a function +that converts these strings into a number. An example of this exists for +linking GVKey -> Permno or Permco (and the reverse), which take in `linkprim` +and `linktype` and convert those to the appropriate priority. +""" +struct LinkPair{T1<:AbstractIdentifier, T2<:AbstractIdentifier} <: AbstractLinkPair{T1, T2} + parent::T1 + child::T2 + dt1::Date# first date valid + dt2::Date# last date valid + priority::Float64# higher is better + function LinkPair( + t1::T1, + t2::T2, + dt1::Union{Missing, Date, AbstractString}=Date(0, 1, 1), + dt2::Union{Missing, Date, AbstractString}=Date(9999, 12, 31), + priority::Real=0.0 + ) where {T1<:AbstractIdentifier, T2<:AbstractIdentifier} + if ismissing(dt1) + dt1 = Date(0, 1, 1) + end + if ismissing(dt2) + dt2 = Date(9999, 12, 31) + end + + if typeof(dt1) == String + dt1 = Date(dt1) + end + if typeof(dt2) == String + dt2 = Date(dt2) + end + return new{T1, T2}(t1, t2, dt1, dt2, priority) + end +end + + + +# GVKey is only ever linked to one CIK +is_higher_priority(data1::LinkPair{T1, T2}, data2::LinkPair{T1, T2}, args...) where {T1<:Union{GVKey, CIK}, T2<:Union{GVKey, CIK}} = false +Base.in(dt::Date, link::LinkPair{T1, T2}) where {T1<:Union{GVKey, CIK}, T2<:Union{GVKey, CIK}} = true +#Base.in(dt::Date, link::LinkPair{T1, T2}) where {T1<:Union{NCusip, RPEntity}, T2<:Union{NCusip, RPEntity}} = min_date(link) <= dt <= max_date(link) + + +function LinkPair( + t1::T1, + t2::T2, + dt1::Union{Missing, Date, AbstractString}, + dt2::Union{Missing, Date, AbstractString}, + linkprim::AbstractString, + linktype::AbstractString, +) where {T1<:GVKey, T2<:Union{Permno, Permco}} + priority = 0.0 + if linkprim == "P" + priority += 3 + elseif linkprim == "C" + priority += 2 + elseif linkprim == "J" + priority += 1 + end + if linktype == "LC" + priority += 0.8 + elseif linktype == "LU" + priority += 0.7 + elseif linktype == "LS" + priority += 0.6 + elseif linktype == "LX" + priority += 0.5 + elseif linktype == "LD" + priority += 0.4 + elseif linktype == "LN" + priority += 0.3 + elseif linktype == "NR" + priority += 0.2 + elseif linktype == "NU" + priority += 0.1 + end + return LinkPair(t1, t2, dt1, dt2, priority) +end + +function LinkPair( + t1::T1, + t2::T2, + dt1::Union{Missing, Date, AbstractString}, + dt2::Union{Missing, Date, AbstractString}, + linkprim::AbstractString, + linktype::AbstractString, +) where {T1<:Union{Permno, Permco}, T2<:GVKey} + priority = 0.0 + if linkprim == "P" + priority += 0.3 + elseif linkprim == "C" + priority += 0.2 + elseif linkprim == "J" + priority += 0.1 + end + if linktype == "LC" + priority += 8 + elseif linktype == "LU" + priority += 7 + elseif linktype == "LS" + priority += 6 + elseif linktype == "LX" + priority += 5 + elseif linktype == "LD" + priority += 4 + elseif linktype == "LN" + priority += 3 + elseif linktype == "NR" + priority += 2 + elseif linktype == "NU" + priority += 1 + end + return LinkPair(t1, t2, dt1, dt2, priority) +end + diff --git a/src/links/specialCases.jl b/src/links/specialCases.jl new file mode 100644 index 0000000..10c83b2 --- /dev/null +++ b/src/links/specialCases.jl @@ -0,0 +1,7 @@ +convert_identifier(::Type{NCusip6}, x::NCusip, args...; vargs...) = NCusip6(x) +convert_identifier(::Type{Cusip6}, x::Cusip, args...; vargs...) = Cusip6(x) +convert_identifier(::Type{NCusip6}, x::NCusip, dt::Date, args...; vargs...) = NCusip6(x) +convert_identifier(::Type{Cusip6}, x::Cusip, dt::Date, args...; vargs...) = Cusip6(x) +# CIK <-> GVKey does not require a date, so just insert any date +CIK(x::GVKey) = CIK(x, today()) +GVKey(x::CIK) = GVKey(x, today()) \ No newline at end of file diff --git a/src/mergeFunctions.jl b/src/mergeFunctions.jl deleted file mode 100644 index 6a7f217..0000000 --- a/src/mergeFunctions.jl +++ /dev/null @@ -1,474 +0,0 @@ - -# struct LinkResult{T<:FirmIdentifier, D1<:Union{Nothing, Date}, D2<:Union{Nothing, Date}} -# id::T -# date_start::D1 -# date_end::D2 -# end - -# LinkResult(id, d1::Union{Nothing, Date}=nothing, d2::Union{Nothing, Date}=nothing) = LinkResult(id, d1, d2) -# LinkResult(id, d1::Date, ::Missing) = LinkResult(id, d1) -# LinkResult(id, ::Missing, ::Missing) = LinkResult(id) - -# struct IDLinkDict{T<:FirmIdentifier, W, D1, D2} -# links::Dict{T, Vector{LinkResult{W, D1, D2}}} -# end - -# get_id(x::LinkResult) = x.id - - -# function Base.getindex(links::IDLinkDict{T}, id::T) where {T <: FirmIdentifier} -# get_id.(links.links[id]) |> unique -# end - -# function Base.getindex(links::IDLinkDict{T, W, D1, D2}, id::T, date::Date) where {T, W <: FirmIdentifier, D1, D2 <: Nothing} -# links[id] -# end - -# function Base.getindex(links::IDLinkDict{T, W, D1, D2}, id::T, date::Date) where {T, W <: FirmIdentifier, D1, D2 <: Date} -# res = links.links[id] -# out = W[] -# for v in res -# if v.date_start <= date <= v.date_end -# push!(out, get_id(v)) -# end -# end -# return out |> unique -# end - -# function Base.getindex(links::IDLinkDict{T, W, D1, D2}, id::T, date::Date) where {T, W <: FirmIdentifier, D1 <: Date, D2 <: Nothing} -# res = links.links[id] -# # assumes the vector is sorted by dates -# for v in res -# if v.date_start <= date <= v.date_end -# return [get_id(v)] -# end -# end -# return W[] -# end - -mutable struct LinkTable - table::String # table name - id_cols::Vector{String} # id cols as they exist in the database - date_col_min::Union{Missing, String} # date column as it is in the database, missing for - # cases where the link is 1:1 - date_col_max::Union{Missing, String} # date column in the database, if missing and min - # is not missing, then date_col_min is assumed to be the minimum date until a new - # date is specified - filters::Dict{String, <:Any} # filters that will be applied when downloading data - type_translations::Vector{Pair{String, Type{<:FirmIdentifier}}} # translate the column - # as downloaded to the correct type -end - -const LINKTABLE_CACHE = Dict{LinkTable, DataFrame}() - -Base.hash(x::LinkTable) = Base.hash("$(x.table) $(join(x.id_cols, ","))") -Base.hash(x::LinkTable, h::UInt) = Base.hash("$(x.table) $(join(x.id_cols, ","))", h) -Base.:(==)(x::LinkTable, y::LinkTable) = Base.hash(x) == Base.hash(y) - -LinkTable(::Type{Permno}, ::Type{T}) where {T<:CusipAll} = LinkTable( - default_tables["crsp_stocknames"], - ["permno", lowercase(string(T))], - "namedt", - "nameenddt", - Dict{String, Any}("ncusip" => missing), - ["permno" => Permno, lowercase(string(T)) => T] -) -LinkTable(::Type{T}, ::Type{Permno}) where {T<:CusipAll} = LinkTable(Permno, T) - -LinkTable(::Type{K}, ::Type{T}) where {K<:CusipAll,T<:CusipAll} = LinkTable( - default_tables["crsp_stocknames"], - [lowercase(string(K)), lowercase(string(T))], - "namedt", - "nameenddt", - Dict{String, Any}("ncusip" => missing), - [lowercase(string(T)) => T, lowercase(string(K)) => K] -) - -LinkTable(::Type{Ticker}, ::Type{T}) where {T<:CusipAll} = LinkTable( - default_tables["crsp_stocknames"], - ["ticker", lowercase(string(T))], - "namedt", - "nameenddt", - Dict{String, Any}("ncusip" => missing), - ["ticker" => Ticker, lowercase(string(T)) => T] -) -LinkTable(::Type{T}, ::Type{Ticker}) where {T<:CusipAll} = LinkTable(Ticker, T) - -LinkTable(::Type{Permno}, ::Type{Ticker}) = LinkTable( - default_tables["crsp_stocknames"], - ["permno", "ticker"], - "namedt", - "nameenddt", - Dict{String, Any}("ncusip" => missing), - ["permno" => Permno, "ticker" => Ticker] -) -LinkTable(::Type{Ticker}, ::Type{Permno}) = LinkTable(Permno, Ticker) - -LinkTable(::Type{Permno}, ::Type{GVKey}) = LinkTable( - default_tables["crsp_a_ccm_ccmxpf_lnkhist"], - ["lpermno", "gvkey"], - "linkdt", - "linkenddt", - Dict{String, Any}( - "linktype" => ["LU", "LC"], - "linkprim" => ["P", "C"], - "lpermno" => missing - ), - ["lpermno" => Permno, "gvkey" => GVKey] -) -LinkTable(::Type{GVKey}, ::Type{Permno}) = LinkTable(Permno, GVKey) - -LinkTable(::Type{Permno}, ::Type{IbesTicker}) = LinkTable( - default_tables["wrdsapps_ibcrsphist"], - ["ticker", "permno"], - "sdate", - "edate", - Dict{String, Any}( - "score" => 1:4, - "permno" => missing - ), - ["permno" => Permno, "ticker" => IbesTicker] -) -LinkTable(::Type{IbesTicker}, ::Type{Permno}) = LinkTable(Permno, IbesTicker) - -LinkTable(::Type{NCusip}, ::Type{IbesTicker}) = LinkTable( - default_tables["wrdsapps_ibcrsphist"], - ["ticker", "ncusip"], - "sdate", - "edate", - Dict{String, Any}( - "score" => 1:4, - "ncusip" => missing - ), - ["ncusip" => NCusip, "ticker" => IbesTicker] -) -LinkTable(::Type{IbesTicker}, ::Type{NCusip}) = LinkTable(NCusip, IbesTicker) - -LinkTable(::Type{GVKey}, ::Type{CIK}) = LinkTable( - default_tables["comp_company"], - ["gvkey", "cik"], - missing, - missing, - Dict{String, Any}( - "cik" => missing - ), - ["gvkey" => GVKey, "cik" => CIK] -) -LinkTable(::Type{CIK}, ::Type{GVKey}) = LinkTable(GVKey, CIK) - -# generic function to convert a pair into the appropriate table -LinkTable(x::Pair{Type{<:FirmIdentifier}, Type{<:FirmIdentifier}}) = LinkTable(x[1], x[2]) - -function Base.merge( - t1::LinkTable, - t2::LinkTable -) - @assert(t1.table == t2.table) - LinkTable( - t1.table, - vcat(t1.id_cols, t2.id_cols) |> unique, - t1.date_col_min, - t1.date_col_max, - merge(t1.filters, t2.filters), - vcat(t1.type_translations, t2.type_translations) |> unique, - ) -end - -function date_cols(table::LinkTable) - x = String[] - if !ismissing(table.date_col_min) - push!(x, table.date_col_min) - end - if !ismissing(table.date_col_max) - push!(x, table.date_col_max) - end - x -end - -function date_subset( - x::Tuple{Date, Date}, - y::Tuple{Date, Date} -) - x[1] >= y[1] && x[2] <= y[2] -end -function date_checks( - d_vec1, - d_vec2 -) - if length(d_vec1) == 1 - return [true] - end - out = ones(Bool, length(d_vec1)) - for (i, x) in enumerate(zip(d_vec1, d_vec2)) - for y in zip(d_vec1, d_vec2) - if x != y && date_subset(x, y) - out[i] = false - break - end - end - end - out -end - -""" -function link_table( - conn, - table::LinkTable, - fil_type::Vector{T}=FirmIdentifier[] -) where {T<:FirmIdentifier} - -Generic function to download data from a linking table -""" -function link_table( - conn, - table::LinkTable, - fil_type::Vector{T}=FirmIdentifier[] -) where {T<:FirmIdentifier} - if 0 < length(fil_type) <= 1000 - temp_filter = Dict{String, Any}() - for (key, val) in table.filters - temp_filter[key] = val - end - table.filters = temp_filter - col_str_temp = "" - for (col, t) in table.type_translations - if t == T - col_str_temp = col - end - end - table.filters[col_str_temp] = value.(fil_type) - end - fil = create_filter(table.filters) - col_str = join(vcat(table.id_cols, date_cols(table)), ", ") - query = """ - SELECT DISTINCT $col_str FROM $(table.table) - $fil - """ - df = WRDSMerger.run_sql_query(conn, query) |> DataFrame - for (col, t) in table.type_translations - df[!, col] = t.(df[:, col]) - rename!(df, col => string(t)) - end - return df -end - - -""" -Takes a built tree and converts it into a list of pairs -""" -function find_item(T::Type{<:FirmIdentifier}, node::FirmIdentifierNode) - if node.data == T - return node - end - out = 0 - for x in node - - if x.data == T - out = x - break - end - out = find_item(T, x) - if out != 0 - break - end - end - - out -end - - -function parent_list(node::FirmIdentifierNode; out=Type{<:FirmIdentifier}[]) - push!(out, node.data) - if parent(node) !== nothing - return parent_list(parent(node); out) - end - out -end - -function build_list(T::Type{<:FirmIdentifier}, tree::FirmIdentifierNode) - bot_node = find_item(T, tree) - if bot_node == 0 - error("The identifier $T is not in the tree, check that all the links work.") - end - out = parent_list(bot_node) |> reverse - out2 = Pair{Type{<:FirmIdentifier}, Type{<:FirmIdentifier}}[] - for i in 1:length(out)-1 - push!(out2, out[i] => out[i+1]) - end - out2 -end - - - -function adjust_date_cols(df::DataFrame, table::LinkTable, date_min::Date, date_max::Date) - if ismissing(table.date_col_max) && !ismissing(table.date_col_min) - col = Dict(table.type_translations...)[table.id_cols[1]] |> string - df[!, table.date_col_min] = coalesce.(df[:, table.date_col_min], date_min) - sort!(df, [col, table.date_col_min]) - gdf = groupby(df, [col]) - df = transform(gdf, table.date_col_min => lead => "date_max") - df[!, "date_max"] = coalesce.(df[:, "date_max"] .- Day(1), date_max)# I subtract a day since use <= later - table.date_col_max = "date_max" - elseif ismissing(table.date_col_min) && ismissing(table.date_col_max) - table.date_col_min = "date_min" - table.date_col_max = "date_max" - df[!, "date_min"] .= date_min - df[!, "date_max"] .= date_max - else - df[!, table.date_col_min] = coalesce.(df[:, table.date_col_min], date_min) - df[!, table.date_col_max] = coalesce.(df[:, table.date_col_max], date_max) - - """ - CRSP seems to have updated the main table used (crsp.stocknames) so that - there are a bunch of repeated values where a linked pair is a complete - subset of another set of dates, this tries to correct for that. - - This is only necessary in the case that all data comes from WRDS, - if both date columns are missing then this does not matter and if - one is missing the adjust_date_cols function handles it as well. - """ - d_cols = [table.date_col_min, table.date_col_max] - g_cols = [string(t) for (i, t) in table.type_translations] - subset!(df, d_cols => ByRow((x, y) -> y >= x)) - transform!(df, d_cols => ByRow((x, y) -> x:Day(1):y) => :date_range) - df = combine(groupby(df, g_cols), :date_range => merge_date_ranges => :date_range) - transform!(df, :date_range => ByRow(x -> (f=x[1], g=x[end])) => d_cols) - select!(df, Not(:date_range)) - df = subset( - groupby(df, g_cols), - d_cols => (x, y) -> date_checks(x, y) - ) - end - df[!, table.date_col_min] = Date.(df[:, table.date_col_min]) - df[!, table.date_col_max] = Date.(df[:, table.date_col_max]) - return df -end - - -function unique_tables( - list, - tables -) - table_names = String[] - out_l = Pair{Type{<:FirmIdentifier}, Type{<:FirmIdentifier}}[] - out_tables = LinkTable[] - for (l, table) in zip(list, tables) - if table.table ∉ table_names - push!(out_l, l) - push!(out_tables, table) - push!(table_names, table.table) - else - i = findfirst(table.table .== table_names) - out_tables[i] = merge(out_tables[i], table) - end - end - (out_l, out_tables) -end - -""" - function link_identifiers( - conn, - cur_ids::Vector{T}, - dates::Vector{Date}, - new_types::Type{<:FirmIdentifier}...; - convert_to_values::Bool=true - ) where {T<:FirmIdentifier} - -Provides links between a firm identifier (on a specific date) and -other firm identifiers provided. Generally, these can then be joined into -a DataFrame. - -This relies on the ability to build a tree from the provided type to other types, -that function in turn relies on `LinkTable` existing for pairs of functions. - -Returns a DataFrame with a column of the ID provided, date, and a column of each -of the requested identifiers. The identifiers have capitalization that follows the -type (i.e., the GVKey column will be titled "GVKey"). - -## Example - -```julia -df = DataFrame( - cik=["0001341439", "0000004447", "0000723254"], - date=[Date(2020), Date(2019), Date(2020)] -) - -leftjoin( - df, - link_identifiers( - CIK.(df.cik), - df.date, - Permno, - Ticker - ), - on=["cik" => "CIK", "date"] -) -``` - -""" -function link_identifiers( - conn, - cur_ids::Vector{T}, - dates::Vector{Date}, - new_types::Type{<:FirmIdentifier}...; - convert_to_values::Bool=true, - validate::Bool=true, - show_tree::Bool=false, - colnames::AbstractVector{<:Pair}=Pair{String, String}[], - use_cache::Bool=true -) where {T<:FirmIdentifier} - df = DataFrame( - ids=cur_ids, - date=dates - ) |> unique - rename!(df, "ids" => string(T)) - tree = build_tree(T) # tree starts from provided type and goes to all available types - show_tree && print_tree(tree) - list = vcat([ - build_list(K, tree) for K in new_types - ]...) |> unique # pairs of types from new_types to the provided type - tables = LinkTable.(list) # get the list of tables, already in order - list, tables = unique_tables(list, tables) # make the tables unique, prevents downloading unnecessary data - for (l, table) in zip(list, tables) - if use_cache && haskey(LINKTABLE_CACHE, table) - new_table = LINKTABLE_CACHE[table] - else - new_table = link_table(conn, table) - if use_cache - LINKTABLE_CACHE[table] = new_table - end - end - if nrow(new_table) == 0 - continue - end - new_table = adjust_date_cols(new_table, table, minimum(df.date), maximum(df.date)) - df = range_join( - df, - new_table, - [string(l[1])], - [ - Conditions("date", >=, table.date_col_min), - Conditions("date", <=, table.date_col_max) - ], - validate=(validate, false), - jointype=:left - ) - select!(df, Not([table.date_col_min, table.date_col_max])) - end - select!(df, unique(string.(vcat([string(T), "date"], [x for x in new_types])))) - - if convert_to_values - for col in names(df) - if col != "date" - df[!, col] = value.(df[:, col]) - end - end - end - for col in colnames - if col[1] ∈ names(df) - rename!(df, col) - end - end - df - -end \ No newline at end of file diff --git a/src/utils.jl b/src/utils.jl index 535e49f..845ba14 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -230,10 +230,8 @@ function filter_data( return fil end -""" -I need the keymap returned instead of the full -SubDataFrame -""" +# I need the keymap returned instead of the full +# SubDataFrame function special_get(gdf, key) if haskey(gdf.keymap, key) x = gdf.keymap[key] @@ -501,156 +499,24 @@ function parse_ons(on) return on1, on2 end -# I wrote this macro a while ago, do not know if it currently works -# function parse_expression( -# expression::Expr -# ) -# out = Expr[] -# if expression.head == :call || expression.head == :comparison -# push!(out, expression) -# return out -# end -# for a in expression.args -# if a.head == :&& || a.head == :|| -# out = vcat(out, parse_expression(a)) -# else a.head == :call -# push!(out, a) -# end -# end -# return out -# end - -# function return_function( -# val::Symbol -# ) -# if val == :< -# return < -# elseif val == :> -# return > -# elseif val == :<= -# return <= -# elseif val == :>= -# return >= -# else -# error("Function Symbol must be a comparison") -# end -# end - -# function reverse_return_function( -# val::Symbol -# ) -# if val == :< -# return return_function(:>) -# elseif val == :> -# return return_function(:<) -# elseif val == :<= -# return return_function(:>=) -# elseif val == :>= -# return return_function(:<=) -# else -# error("Function Symbol must be a comparison") -# end -# end - -# function push_condition!( -# conditions::Array{Tuple{Function, Symbol, Symbol}}, -# f::Symbol, -# first::Expr, -# second::Expr -# ) -# if first.args[1] == :left && second.args[1] == :right -# push!( -# conditions, -# ( -# return_function(f), -# eval(first.args[2]), -# eval(second.args[2]) -# ) -# ) -# elseif first.args[1] == :right && second.args[1] == :left -# push!( -# conditions, -# ( -# reverse_return_function(f), -# eval(second.args[2]), -# eval(first.args[2]) -# ) -# ) -# else -# error("Comparison must have right and left as labels") -# end -# end - -# function expressions_to_conditions( -# expressions::Array{Expr} -# ) -# out = Tuple{Function, Symbol, Symbol}[] -# for x in expressions -# if x.head == :call -# push_condition!( -# out, -# x.args[1], -# x.args[2], -# x.args[3] -# ) -# elseif x.head == :comparison -# for i in 1:2:length(x.args)-1 -# push_condition!( -# out, -# x.args[i+1], -# x.args[i], -# x.args[i+2] -# ) -# end -# end -# end -# return out -# end - - - - - - -# function parse_expr(fil) -# fil = string(fil) -# for (s, r) in [("||", ") .| ("), ("&&", ") .& ("), ("<", ".<"), (">", ".>"), (r"left\.([^\s]*)", s"df1[i, :\1]"), (r"right\.([^\s]*)", s"temp[:, :\1]")] -# fil = replace(fil, s => r) -# end -# fil = "($fil)" -# Meta.parse(fil) -# end - - - - -# function join_helper( -# df1, -# df2, -# on, -# conditions, -# args... -# ) -# #new_conditions = conditions |> parse_expression |> expressions_to_conditions -# quote -# $range_join( -# $df1, -# $df2, -# $on, -# $conditions; -# $(args...) -# ) -# end -# end - -# macro join( -# df1, -# df2, -# on, -# conditions, -# args... -# ) -# local new_conditions = conditions |> parse_expression |> expressions_to_conditions -# #local aakws = [esc(a) for a in args] -# esc(join_helper(df1, df2, on, new_conditions, args...)) -# end + +create_filter(x::AbstractArray{<:Real}) = "IN ($(join(x, ", ")))" +create_filter(x::AbstractArray) = "IN ('$(join(x, "', '"))')" +create_filter(x::Missing) = "IS NOT NULL" +create_filter(x::Real) = "= $x" +create_filter(x::AbstractString) = "= '$x'" + +function create_filter( + filters::Dict{String, <:Any}, + fil = "" +) + for (key, data) in filters + if length(fil) > 0 + fil *= " AND " + else + fil *= " WHERE " + end + fil *= "$key $(create_filter(data))" + end + return fil +end diff --git a/src/utils/dateFunctions.jl b/src/utils/dateFunctions.jl deleted file mode 100644 index 64a89ad..0000000 --- a/src/utils/dateFunctions.jl +++ /dev/null @@ -1,9 +0,0 @@ - -struct BDay <: DatePeriod - value::Int64 - calendar::Union{Symbol, String} - BDay(v::Number, cal::Union{Symbol, String}) = new(v, cal) -end - -Base.:(+)(dt::Date, z::BDay) = advancebdays(z.calendar, dt, z.value) -Base.:(-)(dt::Date, z::BDay) = advancebdays(z.calendar, dt, -1 * z.value) diff --git a/src/utils/identifierTypes.jl b/src/utils/identifierTypes.jl deleted file mode 100644 index 2af00da..0000000 --- a/src/utils/identifierTypes.jl +++ /dev/null @@ -1,288 +0,0 @@ - -# Supertype for all Firm Identifiers -abstract type FirmIdentifier end - -# Some identifiers are essentially strings, this is a super class for all of those -abstract type FirmIdentifierString <: FirmIdentifier end - -# Reamining are similar to integers, this deals with those cases -abstract type FirmIdentifierInt <: FirmIdentifier end - -# Technically, there is only 1 Cusip, however, WRDS considers two types (NCusip and Cusip) -# which are basicaly just old and current versions, since other than the actual -# numbers, these are exactly the samne, this abstract type deals with all of those -# so I can have common functions -abstract type CusipAll <: FirmIdentifierString end - -# checksum calculator for Cusip -function luhn_checksum(s) - if length(s) != 8 - error("Length must be 8 digits") - end - tot = 0 - for (i, v) in enumerate(s) - n = if '0' ≤ v ≤ '9' - parse(Int, v) - elseif 'A' ≤ v ≤ 'Z' - Int(v) - 65 + 10 - elseif 'a' ≤ v ≤ 'z' - Int(v) - 97 + 10 - elseif v == '*' - 36 - elseif v == '@' - 37 - elseif v == '#' - 38 - end - if iseven(i) - n *= 2 - end - tot += floor(n / 10) + n % 10 - end - (10 - tot % 10) % 10 |> Int -end - - -""" -GVKey is the primary identifier in the Compustat universe -It is a string, though only has numeric values -""" -struct GVKey <: FirmIdentifierString - val::String - function GVKey(s::String) - if length(s) > 6 - error("GVKey must be 6 characters long") - end - if occursin(r"\D", s) - error("GVKey can only contain numeric characters") - end - new(lpad(s, 6, "0")) - end -end - -GVKey(n::Real) = GVKey(string(Int(n))) - -""" -CIK is a common identifier outside of WRDS -It is a string, though has numeric values -""" -struct CIK <: FirmIdentifierString - val::String - function CIK(s::String) - if length(s) > 10 - error("CIK must be 10 characters long") - end - if occursin(r"\D", s) - error("CIK can only contain numeric characters") - end - new(lpad(s, 10, "0")) - end -end - -CIK(n::Real) = CIK(string(Int(n))) - -""" -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 (6 characters) -issue (2 characters), and a checksum -most databases in WRDS only use the 8 characters -""" -struct Cusip <: CusipAll - issuer::String - issue::String - checksum::Int - function Cusip(issuer::AbstractString, issue::AbstractString, checksum::Int) - if length(issuer) != 6 - error("Issuer identification must be 6 characters") - end - if length(issue) != 2 - error("Issue must be 2 characters") - end - if (!)(0 ≤ checksum ≤ 9) - error("Checksum must be between 0 and 9 (inclusive)") - end - if luhn_checksum(issuer * issue) != checksum - error("Invalid Cusip or Checksum") - end - new(String(issuer), String(issue), checksum) - end -end - -function Cusip(s::AbstractString) - if length(s) == 9 - Cusip(s[1:6], s[7:8], parse(Int, s[9])) - elseif length(s) == 8 - Cusip(s[1:6], s[7:8], luhn_checksum(s)) - else - error("Cusip must be 8 or 9 characters") - end -end - -Cusip(issuer::AbstractString, issue::AbstractString) = Cusip(issuer, issue, luhn_checksum(issuer * issue)) - - -""" -See note on Cusip -""" -struct NCusip <: CusipAll - issuer::String - issue::String - checksum::Int - function NCusip(issuer::AbstractString, issue::AbstractString, checksum::Int) - if length(issuer) != 6 - error("Issuer identification must be 6 characters") - end - if length(issue) != 2 - error("Issue must be 2 characters") - end - if (!)(0 ≤ checksum ≤ 9) - error("Checksum must be between 0 and 9 (inclusive)") - end - if luhn_checksum(issuer * issue) != checksum - error("Invalid NCusip or Checksum") - end - new(string(issuer), string(issue), checksum) - end -end - -function NCusip(s::AbstractString) - if length(s) == 9 - NCusip(s[1:6], s[7:8], parse(Int, s[9])) - elseif length(s) == 8 - NCusip(s[1:6], s[7:8], luhn_checksum(s)) - else - error("NCusip must be 8 or 9 characters") - end -end - -NCusip(issuer::AbstractString, issue::AbstractString) = NCusip(issuer, issue, luhn_checksum(issuer * issue)) - -Cusip(x::NCusip) = Cusip(x.issuer, x.issue, x.checksum) -NCusip(x::Cusip) = NCusip(x.issuer, x.issue, x.checksum) - -""" -Ticker here refers to the ticker that is on the NYSE (not to be confused with IbesTicker) -While a common identifier outside of WRDS, this is not recommended since they change often -""" -struct Ticker <: FirmIdentifierString - val::String -end - -Ticker(s::AbstractString) = Ticker(string(s)) - - -""" -IbesTicker is the primary identifier in the IBES universe -""" -struct IbesTicker <: FirmIdentifierString - val::String -end - -IbesTicker(s::AbstractString) = IbesTicker(string(s)) - -""" -Permno is the primary identifier of securities 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 IBES, Compustat (GVKey), and Cusip. -""" -struct Permno <: FirmIdentifierInt - val::Int -end - -Permno(x::Real) = Permno(Int(x)) - -Permno(x::Permno) = x -Cusip(x::Cusip) = x -CIK(x::CIK) = x -GVKey(x::GVKey) = x -NCusip(x::NCusip) = x -Ticker(x::Ticker) = x -IbesTicker(x::IbesTicker) = x - -Permno(x::Missing) = x -Cusip(x::Missing) = x -CIK(x::Missing) = x -GVKey(x::Missing) = x -NCusip(x::Missing) = x -Ticker(x::Missing) = x -IbesTicker(x::Missing) = x - -###################################################################################### -# As long as convert is specified for an identifier, all of the other functions here -# should work automatically work (as long as the type fits into string or integer) -###################################################################################### - -# Used for Permno -Base.convert(::Type{T}, x::K) where {T<:Real,K<:FirmIdentifierInt} = convert(T, x.val) - -# Used for Permno, GVKey, and CIK -Base.convert(::Type{K}, x::Real) where {K<:FirmIdentifier} = K(x) - -# Used for GVKey, CIK, Ticker, and IbesTicker -Base.convert(::Type{T}, x::K) where {T<:AbstractString,K<:FirmIdentifierString} = convert(T, x.val) - -# Special case for GVKey and CIK -Base.convert(::Type{T}, x::GVKey) where {T<:Real} = parse(T, x.val) -Base.convert(::Type{T}, x::CIK) where {T<:Real} = parse(T, x.val) - -# Used for GVKey, CIK, Ticker, IbesTicker, Cusip, and NCusip -Base.convert(::Type{K}, x::AbstractString) where {K<:FirmIdentifierString} = K(x) - -# Used for Cusip and NCusip -Base.convert(::Type{T}, x::K) where {T<:AbstractString,K<:CusipAll} = convert(T, "$(x.issuer)$(x.issue)") - -# Comparisons -# These all convert the non-identifier into an identifier before back to the base value -# This ensures consistency in the comparison, no issues with CIK being an Int in one place and a string in another - -# I am not sure these are actually useful, they were made to try and make joins possible but that is handled by hash -Base.:(==)(id::K, s::T) where {T<:AbstractString, K<:FirmIdentifier} = convert(T, id) == convert(T, convert(K, s)) -Base.:(==)(s::T, id::K) where {T<:AbstractString, K<:FirmIdentifier} = convert(T, convert(K, s)) == convert(T, id) - -# isless is valuable for sorting -Base.isless(id::K, s::T) where {T<:AbstractString, K<:FirmIdentifier} = isless(convert(T, id), convert(T, convert(K, s))) -Base.isless(s::T, id::K) where {T<:AbstractString, K<:FirmIdentifier} = isless(convert(T, convert(K, s)), convert(T, id)) -Base.isless(id1::FirmIdentifier, id2::FirmIdentifier) = isless(value(id1), value(id2)) - -# String based identifiers - -Base.show(io::IOContext, id::FirmIdentifierString) = show(io, convert(String, id)) -# Base.print(io::IOContext, x::GVKey) = print(io, x.val) -Base.string(id::FirmIdentifierString) = convert(String, id) - -# tryparse is useful for csv -Base.tryparse(::Type{T}, s::AbstractString) where {T<:FirmIdentifierString} = try T(s) catch nothing end -value(id::FirmIdentifierString) = convert(String, id) - -# Special "value" parameter for CusipAll so it can return 9 characters -value(x::CusipAll, l::Int=8) = "$(x.issuer)$(x.issue)$(x.checksum)"[1:l] - -Base.promote_rule(::Type{T}, ::Type{K}) where {T<:FirmIdentifierString,K<:AbstractString} = K - -Base.hash(id::FirmIdentifierString) = hash(convert(String, id)) - -# Integer based identifiers - -Base.show(io::IOContext, id::FirmIdentifierInt) = show(io, convert(Int, id)) -Base.string(id::FirmIdentifierInt) = string(convert(Int, id)) -value(id::FirmIdentifierInt) = convert(Int, id) - -Base.promote_rule(::Type{T}, ::Type{K}) where {T<:FirmIdentifierInt,K<:Real} = K -Base.tryparse(::Type{T}, s::AbstractString) where {T<:FirmIdentifierInt} = try T(parse(Int, s)) catch nothing end -Base.hash(id::FirmIdentifierInt) = hash(convert(Int, id)) - -# to prevent errors for missing data -value(x::Missing) = missing - -###################################################################################### -# Future notes: One thing that would be nice is if I could specify `isequal` for -# items that are "number like", for example, it would be nice if -# GVKey("000015") == 15 returned true (which is easy) and the has values were the same -# (which I cannot figure out how to do). As far as I can tell, I can specify the hash -# value as either a String or an Integer, but not both - -# Another future task is to make the has value of a tuple to be the same as the base -# version, right now this works well for normal joins but not well for groupby, -# which of course is what my join function relies on -###################################################################################### \ No newline at end of file diff --git a/src/utils/linkTree.jl b/src/utils/linkTree.jl deleted file mode 100644 index 4a9bcf0..0000000 --- a/src/utils/linkTree.jl +++ /dev/null @@ -1,122 +0,0 @@ - -""" -This section relies heavily on AbstractTrees.jl -The goal is to build a tree structure starting from -an arbitrary type to all other defined types. -Once this tree is created, it is relatively easy to -go back and find where I want to get on the tree -(basically, the end type) and see the tables necessary -to get there. -""" - -mutable struct FirmIdentifierNode - - data::Type{<:FirmIdentifier} - parent::FirmIdentifierNode - children::Vector{FirmIdentifierNode} - - # Root constructor - FirmIdentifierNode(data) = new(data) - # child node constructor - FirmIdentifierNode(data, parent::FirmIdentifierNode) = new(data, parent) -end - -function addchild(data, parent::FirmIdentifierNode) - if !isdefined(parent, :children) - parent.children = FirmIdentifierNode[] - end - push!(parent.children, FirmIdentifierNode(data, parent)) -end - -function AbstractTrees.children(node::FirmIdentifierNode) - return node - #isdefined(node, :children) && node.children - # return node.children -end - -AbstractTrees.printnode(io::IO, node::FirmIdentifierNode) = print(io, node.data) - -function Base.iterate(node::FirmIdentifierNode, state::Int=1) - isdefined(node, :children) && length(node.children) >= state && return (node.children[state], state+1) - return nothing -end - -Base.IteratorSize(::Type{FirmIdentifierNode}) = Base.SizeUnknown() -Base.eltype(::Type{FirmIdentifierNode}) = FirmIdentifierNode - -Base.IteratorEltype(::Type{<:TreeIterator{FirmIdentifierNode}}) = Base.HasEltype() -AbstractTrees.parentlinks(::Type{FirmIdentifierNode}) = AbstractTrees.StoredParents() -AbstractTrees.siblinglinks(::Type{FirmIdentifierNode}) = AbstractTrees.StoredSiblings() - - -Base.parent(root::FirmIdentifierNode, node::FirmIdentifierNode) = isdefined(node, :parent) ? node.parent : nothing -Base.parent(node::FirmIdentifierNode) = isdefined(node, :parent) ? node.parent : nothing - -Base.pairs(node::FirmIdentifierNode) = enumerate(node) - -## - -""" -These are the functions necessary to construct the tree -""" - -function get_root(node::FirmIdentifierNode) - if parent(node) !== nothing - return get_root(parent(node)) - end - return node -end - -function existing_types( - node::FirmIdentifierNode; - out=Type{<:FirmIdentifier}[] -) - - push!(out, node.data) - for x in node - push!(out, x.data) - existing_types(x; out) - end - - out -end - - -function base_firm_identifiers_types( - x::Type{<:FirmIdentifier}; - out=Type{<:FirmIdentifier}[] -) - for y in subtypes(x) - if isabstracttype(y) - out=base_firm_identifiers_types(y; out) - else - push!(out, y) - end - end - - out |> unique -end - -function build_tree_base(x::FirmIdentifierNode) - for y in base_firm_identifiers_types(FirmIdentifier) - - - if isabstracttype(y) || y == x.data || y ∈ existing_types(get_root(x)) - continue - end - if !isempty(methods(LinkTable, (Type{x.data}, Type{y}))) - addchild(y, x) - end - end - if isdefined(x, :children) - for y in x - build_tree_base(y) - end - end -end - -function build_tree(x::Type{<:FirmIdentifier}) - root = FirmIdentifierNode(x) - build_tree_base(root) - return root -end \ No newline at end of file diff --git a/src/utils/utils.jl b/src/utils/utils.jl deleted file mode 100644 index 4521e3d..0000000 --- a/src/utils/utils.jl +++ /dev/null @@ -1,22 +0,0 @@ - - -create_filter(x::AbstractArray{<:Real}) = "IN ($(join(x, ", ")))" -create_filter(x::AbstractArray) = "IN ('$(join(x, "', '"))')" -create_filter(x::Missing) = "IS NOT NULL" -create_filter(x::Real) = "= $x" -create_filter(x::AbstractString) = "= '$x'" - -function create_filter( - filters::Dict{String, <:Any}, - fil = "" -) - for (key, data) in filters - if length(fil) > 0 - fil *= " AND " - else - fil *= " WHERE " - end - fil *= "$key $(create_filter(data))" - end - return fil -end diff --git a/test/data/car_results.csv b/test/data/car_results.csv deleted file mode 100644 index 84e7ba6..0000000 --- a/test/data/car_results.csv +++ /dev/null @@ -1,8 +0,0 @@ -permno,event_date,alpha_market_model_,beta_market_model,cumulative_total_return,car_ma,bhar_ma,estimation_period_variance_market_adjusted_returns_,car_mm,bhar_mm,estimation_period_variance_market_model_,car_ff,bhar_ff,estimation_period_variance_ff_model_,car_ffm,bhar_ffm,estimation_period_variance_carhart_model_,number_of_non_missing_returns_in_event_window,length_of_the_estimation_period -61516,2020-06-22,0.00249,0.734,0.035,0.0446,0.0436,0.0004138538,-0.0091,-0.0128,0.0003705862,-0.043899999999999995,-0.050300000000000004,0.0003422305,0.0226,0.0212,0.0003155708,21,150 -76185,2020-06-22,0.00164,0.68,-0.0165,-0.00907,-0.00784,0.0003116537,-0.0452,-0.0462,0.0002468446,-0.09630000000000001,-0.1,0.0002103135,-0.115,-0.121,0.0002095378,21,150 -87445,2020-06-22,0.00032,1.103,-0.212,-0.22699999999999998,-0.204,0.0005872581,-0.23399999999999999,-0.209,0.0005843541,-0.20600000000000002,-0.17800000000000002,0.0004504447,-0.287,-0.264,0.0004099789,21,150 -14763,2020-09-21,0.0029,1.146,0.0355,0.0397,0.0391,0.0006154113,-0.0209,-0.022400000000000003,0.0006042849,-0.047599999999999996,-0.0482,0.0004776297,-0.0828,-0.0872,0.0004491512,21,150 -15291,2020-09-21,0.00729,1.011,0.17600000000000002,0.17300000000000001,0.18,0.0016903294,0.0203,0.015700000000000002,0.0017014126,0.0256,0.0253,0.0015561184,-0.0172,-0.024700000000000003,0.0015200647,21,150 -51369,2020-09-21,0.0017499999999999998,1.239,-0.008539999999999999,-0.00244,-0.005,0.0005040819,-0.038900000000000004,-0.0408,0.0004664795,-0.0453,-0.047,0.0004658973,-0.0516,-0.0537,0.0004680909,21,150 -82515,2020-10-07,0.0023499999999999997,0.887,0.156,0.10400000000000001,0.113,0.0005257526,0.0596,0.06570000000000001,0.000520198,0.0729,0.08070000000000001,0.0004847521,0.0564,0.06269999999999999,0.0004816026,21,150 diff --git a/test/data/crsp_comp_links.csv b/test/data/crsp_comp_links.csv new file mode 100644 index 0000000..70c752d --- /dev/null +++ b/test/data/crsp_comp_links.csv @@ -0,0 +1,125 @@ +gvkey,linkprim,liid,linktype,lpermno,lpermco,linkdt,linkenddt +001380,P,01,LC,28484,20064,1964-03-31, +001380,N,01C,LX,28484,20064,1998-05-29,2016-11-30 +001380,J,01C,LX,28484,20064,2016-12-01, +001449,P,01,LU,57904,92,1973-08-23, +001487,P,01,LC,66800,137,1972-12-14, +001976,P,01,LC,75034,20253,1987-04-24,2017-07-04 +002220,P,01,LC,61516,655,1982-01-29, +002269,P,01,LU,49373,20309,1969-10-13, +002403,C,00X,LU,19393,20331,1950-01-01,1962-01-30 +002403,P,01,LU,19393,20331,1962-01-31, +002968,P,01,LC,47896,20436,1969-03-05, +002991,C,00X,LU,14541,20440,1950-01-01,1962-01-30 +002991,P,01,LU,14541,20440,1962-01-31, +003026,P,01,LU,23393,1103,1976-12-30, +003062,P,01,LC,23660,6304,1983-08-19, +003221,P,01,LC,61735,20203,1980-06-02, +003231,P,01,LC,25081,1261,1972-12-14, +004060,P,01,LC,16851,56027,2017-09-01, +004199,C,00X,LS,11762,20627,1950-01-01,1962-01-30 +004199,P,01,LS,11762,20627,1962-01-31, +004839,C,00X,LC,25785,20750,1950-01-01,1962-01-30 +004839,P,01,LC,25785,20750,1962-01-31, +004885,P,01,LU,37584,6407,1983-09-23, +005046,C,00X,LC,12052,20791,1954-01-01,1962-01-30 +005046,P,01,LC,12052,20791,1962-01-31, +005071,C,00X,LC,17144,20798,1950-06-01,1962-01-30 +005071,P,01,LC,17144,20798,1962-01-31, +005073,P,19,LC,12369,53554,2010-11-18, +005073,N,19C,LX,12369,53554,2014-03-31, +005439,C,00X,LU,23819,20868,1950-01-01,1962-01-30 +005439,P,01,LU,23819,20868,1962-01-31, +005518,P,01,LU,52978,20887,1971-08-11, +005597,C,00X,LC,16600,20906,1950-01-01,1962-01-30 +005597,P,01,LC,16600,20906,1962-01-31, +005643,P,04,LC,14338,54672,2013-12-12, +006008,P,01,LU,59328,2367,1972-12-14, +006266,C,00X,LC,22111,21018,1950-01-01,1962-01-30 +006266,P,01,LC,22111,21018,1962-01-31, +006669,P,01,LC,52708,21095,1971-06-23, +006829,P,01,LU,61399,2709,1972-12-14, +007063,P,01,LC,46703,21157,1968-08-26, +007171,P,01,LC,81061,30521,1994-12-01, +007241,C,00X,LC,17005,21185,1950-01-01,1962-01-30 +007241,P,01,LC,17005,21185,1962-01-31, +007257,C,00X,LC,22752,21188,1950-01-01,1962-01-01 +007257,P,01,LC,22752,21188,1962-01-02, +007435,C,00X,LC,22592,21205,1950-01-01,1962-01-30 +007435,P,01,LC,22592,21205,1962-01-31, +007585,C,00X,LC,22779,21230,1950-01-01,1962-01-30 +007585,P,01,LC,22779,21230,1962-01-31, +007637,P,01,LC,20057,57529,2020-11-17, +007875,P,01,LC,60986,3178,1972-12-14, +007906,P,01,LU,57665,3194,1980-12-02, +007970,P,01,LC,44206,21299,1967-02-20, +007974,P,01,LU,38762,21244,1962-12-19, +008402,P,01,LU,61621,6333,1983-08-26, +008463,P,01,LC,13586,54185,2012-09-29, +008549,C,00X,LC,13928,21401,1950-01-01,1962-01-30 +008549,P,01,LC,13928,21401,1962-01-31, +008549,N,01C,LX,13928,21401,1998-07-31, +008972,C,00X,LU,24942,21492,1952-09-15,1962-02-27 +008972,P,01,LU,24942,21492,1962-02-28,2020-04-30 +009667,P,01,LC,36468,21609,1962-07-02, +009846,C,00X,LU,15720,21543,1951-01-01,1962-01-30 +009846,P,01,LU,15720,21543,1962-01-31, +010453,P,01,LC,51369,21731,1970-10-19, +010789,P,01,LC,76185,26080,1990-05-22, +010894,P,01,LU,59300,3334,1980-02-11, +010983,C,00X,LC,17830,21832,1950-01-01,1962-01-30 +010983,P,01,LC,17830,21832,1962-01-31, +011032,P,01,LU,79637,4655,1981-07-09, +011228,C,00X,LC,15202,21876,1960-01-01,1962-01-30 +011228,P,01,LC,15202,21876,1962-01-31, +011456,P,01,LC,39917,21914,1963-12-06, +011856,C,00X,LC,71563,4163,1982-01-01,1982-01-28 +011856,P,01,LC,71563,4163,1982-01-29, +012142,P,01,LC,10104,8045,1986-03-12, +013498,P,01,LC,75154,20394,1987-07-24, +013721,P,01,LC,13788,54327,2013-02-01, +014256,P,01,LC,11896,9698,1988-02-29,2007-10-01 +014256,P,01,LC,11896,9698,2008-10-08,2021-08-31 +014275,P,04,LC,12448,53609,2010-12-09, +016101,P,01,LC,13721,54287,2013-01-02, +016478,P,01,LU,75825,22113,1989-10-04, +016721,P,01,LU,75828,10303,1989-09-20, +018043,P,01,LC,13963,54433,2013-07-01, +020228,P,01,LC,14763,54931,2014-07-31, +023238,P,01,LC,15291,55229,2015-04-16, +023809,P,01,LU,76605,29009,1991-04-02, +024731,P,01,LC,77129,29335,1991-11-22, +024925,P,01,LU,77338,11344,1992-02-13, +024975,P,01,LU,77357,11361,1992-02-26, +025434,P,01,LU,77702,11592,1992-06-26, +027845,P,01,LC,78916,11965,1993-02-17,2020-05-29 +028191,P,01,LU,79145,29819,1993-04-28, +029099,P,01,LU,79782,30011,1993-10-29, +029875,P,01,LU,80381,30345,1994-03-11, +030923,P,01,LC,16538,55833,2017-01-17, +032106,P,01,LC,75034,20253,2017-07-05, +034443,P,01,LC,18428,56668,2019-04-02, +036203,P,01,LC,19807,57315,2020-10-09, +061388,P,01,LU,82303,30970,1995-10-03, +061420,P,01,LU,82515,14046,1995-10-13, +062374,P,01,LU,83143,14330,1996-02-01, +063892,P,01,LC,84032,31769,1996-10-29, +064166,P,01,LU,84373,31838,1997-01-14, +064768,P,01,LC,84788,15473,1997-05-15, +121077,P,01,LU,86964,16561,1999-06-04, +121382,P,01,LU,86996,16584,1999-06-16, +126721,P,01,LU,87445,36380,1999-11-30, +133366,P,01,LC,87657,36952,2000-04-03, +143974,P,01,LC,89002,41671,2001-06-08, +144009,P,01,LC,89017,41694,2001-06-12, +144559,P,01,LC,89070,41870,2001-08-07, +145552,P,01,LC,89269,42540,2001-12-13, +149070,P,01,LC,89626,43791,2002-12-06, +157057,P,01,LC,90038,44893,2004-02-05, +158742,P,01,LC,90454,45878,2004-11-05, +160991,P,01,LC,90373,45684,2004-10-29, +162129,P,01,LC,90386,45695,2004-10-25, +163610,P,01,LC,90993,48793,2005-11-16, +164708,P,01,LC,90880,47422,2005-10-03, +175955,P,01,LC,91668,51555,2006-12-13, +184700,P,01,LC,12449,53610,2010-12-15, diff --git a/test/data/crsp_links.csv b/test/data/crsp_links.csv new file mode 100644 index 0000000..0d35a60 --- /dev/null +++ b/test/data/crsp_links.csv @@ -0,0 +1,451 @@ +permno,namedt,nameenddt,shrcd,exchcd,siccd,ncusip,ticker,comnam,shrcls,permco,hexcd,cusip,st_date,end_date,namedum,mkt_cap +10104,1986-03-12,1995-05-31,11,3,7370,68389X10,ORCL,ORACLE SYSTEMS CORP,,8045,1,68389X10,1986-03-12,2022-12-30,2,3.576181141697041e6 +10104,1995-06-01,2013-07-14,11,3,7370,68389X10,ORCL,ORACLE CORP,,8045,1,68389X10,1986-03-12,2022-12-30,2,8.843690026079649e7 +10104,2013-07-15,2022-12-30,11,1,7372,68389X10,ORCL,ORACLE CORP,,8045,1,68389X10,1986-03-12,2022-12-30,2,1.862657690184227e8 +11762,1925-12-31,1932-03-15,11,1,3710,,,EATON AXLE & SPRING CO,,20627,1,G2918310,1925-12-31,2022-12-30,2,9191.02383531961 +11762,1932-03-16,1962-07-01,11,1,3710,,,EATON MFG CO,,20627,1,G2918310,1925-12-31,2022-12-30,2,57087.85011075015 +11762,1962-07-02,1966-01-02,11,1,3714,,ENX,EATON MFG CO,,20627,1,G2918310,1925-12-31,2022-12-30,2,273373.13293650793 +11762,1966-01-03,1968-01-01,11,1,3714,,ENX,EATON YALE & TOWNE INC,,20627,1,G2918310,1925-12-31,2022-12-30,2,432003.71520874754 +11762,1968-01-02,1971-04-25,11,1,3714,27828110,ENX,EATON YALE & TOWNE INC,,20627,1,G2918310,1925-12-31,2022-12-30,2,567140.9325495049 +11762,1971-04-26,2001-01-31,11,1,3714,27805810,ETN,EATON CORP,,20627,1,G2918310,1925-12-31,2022-12-30,2,2.270446758172963e6 +11762,2001-02-01,2004-02-17,11,1,3625,27805810,ETN,EATON CORP,,20627,1,G2918310,1925-12-31,2022-12-30,2,5.641566396409733e6 +11762,2004-02-18,2012-12-02,11,1,3714,27805810,ETN,EATON CORP,,20627,1,G2918310,1925-12-31,2022-12-30,2,1.1907668367606353e7 +11762,2012-12-03,2016-06-22,12,1,3569,G2918310,ETN,EATON CORP PLC,,20627,1,G2918310,1925-12-31,2022-12-30,2,3.0468770243295982e7 +11762,2016-06-23,2020-02-17,12,1,3629,G2918310,ETN,EATON CORP PLC,,20627,1,G2918310,1925-12-31,2022-12-30,2,3.371708174710462e7 +11762,2020-02-18,2021-03-28,12,1,3679,G2918310,ETN,EATON CORP PLC,,20627,1,G2918310,1925-12-31,2022-12-30,2,4.1316893081311144e7 +11762,2021-03-29,2022-06-07,12,1,3629,G2918310,ETN,EATON CORP PLC,,20627,1,G2918310,1925-12-31,2022-12-30,2,6.1534687267107375e7 +11762,2022-06-08,2022-12-30,12,1,8742,G2918310,ETN,EATON CORP PLC,,20627,1,G2918310,1925-12-31,2022-12-30,2,5.770649619177972e7 +11896,1988-02-29,2007-10-01,11,3,3670,57772K10,MXIM,MAXIM INTEGRATED PRODUCTS INC,,9698,3,57772K10,1988-02-29,2021-08-25,2,6.608536105636924e6 +11896,2007-10-02,2008-10-07,11,0,3674,57772K10,,MAXIM INTEGRATED PRODUCTS INC,,9698,3,57772K10,1988-02-29,2021-08-25,2,0.0 +11896,2008-10-08,2021-08-25,11,3,3674,57772K10,MXIM,MAXIM INTEGRATED PRODUCTS INC,,9698,3,57772K10,1988-02-29,2021-08-25,2,1.1161336866381241e7 +12052,1926-01-28,1952-04-23,11,1,3730,,,ELECTRIC BOAT CO,,20791,1,36955010,1926-01-28,2022-12-30,2,8784.541726013207 +12052,1952-04-24,1962-07-01,11,1,3730,,,GENERAL DYNAMICS CORP,,20791,1,36955010,1926-01-28,2022-12-30,2,308995.29262470774 +12052,1962-07-02,1968-01-01,11,1,3721,,GD,GENERAL DYNAMICS CORP,,20791,1,36955010,1926-01-28,2022-12-30,2,419150.94936823106 +12052,1968-01-02,1978-04-02,11,1,3721,36955010,GD,GENERAL DYNAMICS CORP,,20791,1,36955010,1926-01-28,2022-12-30,2,361799.11034010944 +12052,1978-04-03,2014-01-21,11,1,3731,36955010,GD,GENERAL DYNAMICS CORP,,20791,1,36955010,1926-01-28,2022-12-30,2,1.0701303440063432e7 +12052,2014-01-22,2022-12-30,11,1,3721,36955010,GD,GENERAL DYNAMICS CORP,,20791,1,36955010,1926-01-28,2022-12-30,2,5.126217946614048e7 +12369,2010-11-18,2022-12-30,11,1,3711,37045V10,GM,GENERAL MOTORS CO,,53554,1,37045V10,2010-11-18,2022-12-30,2,5.246217215531898e7 +12448,2010-12-09,2011-06-16,11,1,6022,33616C10,FRC,FIRST REPUBLIC BANK S F NEW,,53609,1,33616C10,2010-12-09,2022-12-30,2,3.8769663087885035e6 +12448,2011-06-17,2016-10-09,11,1,6282,33616C10,FRC,FIRST REPUBLIC BANK S F NEW,,53609,1,33616C10,2010-12-09,2022-12-30,2,6.5387037384814685e6 +12448,2016-10-10,2021-04-04,11,1,6022,33616C10,FRC,FIRST REPUBLIC BANK S F NEW,,53609,1,33616C10,2010-12-09,2022-12-30,2,1.6909536146752894e7 +12448,2021-04-05,2022-12-30,11,1,6029,33616C10,FRC,FIRST REPUBLIC BANK S F NEW,,53609,1,33616C10,2010-12-09,2022-12-30,2,3.0068420943990555e7 +12449,2010-12-15,2022-12-30,11,1,7389,33904110,FLT,FLEETCOR TECHNOLOGIES INC,,53610,1,33904110,2010-12-15,2022-12-30,2,1.3902336522311863e7 +13586,2012-10-01,2013-04-15,12,1,4941,H6169Q10,PNR,PENTAIR LTD,,54185,1,G7S00T10,2012-10-01,2022-12-30,2,1.0231048394892527e7 +13586,2013-04-16,2014-06-02,12,1,3823,H6169Q10,PNR,PENTAIR LTD,,54185,1,G7S00T10,2012-10-01,2022-12-30,2,1.3574516188170504e7 +13586,2014-06-03,2015-02-05,12,1,3823,G7S00T10,PNR,PENTAIR PLC,,54185,1,G7S00T10,2012-10-01,2022-12-30,2,1.2903405684820974e7 +13586,2015-02-06,2017-12-25,12,1,3491,G7S00T10,PNR,PENTAIR PLC,,54185,1,G7S00T10,2012-10-01,2022-12-30,2,1.0926407454441275e7 +13586,2017-12-26,2022-12-30,12,1,3559,G7S00T10,PNR,PENTAIR PLC,,54185,1,G7S00T10,2012-10-01,2022-12-30,2,8.542721778160682e6 +13721,2013-01-02,2022-12-30,11,1,2834,00287Y10,ABBV,ABBVIE INC,,54287,1,00287Y10,2013-01-02,2022-12-30,2,1.3576169502921283e8 +13788,2013-02-01,2022-12-30,11,1,2834,98978V10,ZTS,ZOETIS INC,A,54327,1,98978V10,2013-02-01,2022-12-30,2,4.3771793361571535e7 +13928,1925-12-31,1962-07-01,11,1,2910,,,PHILLIPS PETROLEUM CO,,21401,1,20825C10,1925-12-31,2022-12-30,2,496976.24993335595 +13928,1962-07-02,1968-01-01,11,1,2911,,P,PHILLIPS PETROLEUM CO,,21401,1,20825C10,1925-12-31,2022-12-30,2,1.791473014259928e6 +13928,1968-01-02,2001-08-23,11,1,2911,71850710,P,PHILLIPS PETROLEUM CO,,21401,1,20825C10,1925-12-31,2022-12-30,2,6.12727327530128e6 +13928,2001-08-24,2002-09-02,11,1,1311,71850710,P,PHILLIPS PETROLEUM CO,,21401,1,20825C10,1925-12-31,2022-12-30,2,2.153400596645845e7 +13928,2002-09-03,2004-02-17,11,1,1311,20825C10,COP,CONOCOPHILLIPS,,21401,1,20825C10,1925-12-31,2022-12-30,2,3.6602669713910855e7 +13928,2004-02-18,2014-01-30,11,1,2911,20825C10,COP,CONOCOPHILLIPS,,21401,1,20825C10,1925-12-31,2022-12-30,2,8.86507038804311e7 +13928,2014-01-31,2022-12-30,11,1,1382,20825C10,COP,CONOCOPHILLIPS,,21401,1,20825C10,1925-12-31,2022-12-30,2,7.510434938530162e7 +13963,2013-07-01,2022-12-30,11,3,9999,65249B10,NWSA,NEWS CORP NEW,A,54433,3,65249B10,2013-07-01,2022-12-30,2,6.060144500835695e6 +14338,2013-12-12,2017-01-03,11,1,7011,43300A10,HLT,HILTON WORLDWIDE HOLDINGS INC,,54672,1,43300A20,2013-12-12,2022-12-30,2,2.381632378548584e7 +14338,2017-01-04,2022-12-30,11,1,7011,43300A20,HLT,HILTON WORLDWIDE HOLDINGS INC,,54672,1,43300A20,2013-12-12,2022-12-30,2,2.820798986917468e7 +14541,1925-12-31,1962-07-01,11,1,2910,,,STANDARD OIL CO CALIFORNIA,,20440,1,16676410,1925-12-31,2022-12-30,2,1.1371239879810023e6 +14541,1962-07-02,1968-01-01,11,1,2911,,SD,STANDARD OIL CO CALIFORNIA,,20440,1,16676410,1925-12-31,2022-12-30,2,4.805060065613719e6 +14541,1968-01-02,1984-04-01,11,1,2911,85368310,SD,STANDARD OIL CO CALIFORNIA,,20440,1,16676410,1925-12-31,2022-12-30,2,7.562235307303164e6 +14541,1984-04-02,2001-10-09,11,1,2911,16675110,CHV,CHEVRON CORP,,20440,1,16676410,1925-12-31,2022-12-30,2,3.135941880330444e7 +14541,2001-10-10,2005-05-09,11,1,2911,16676410,CVX,CHEVRONTEXACO CORP,,20440,1,16676410,1925-12-31,2022-12-30,2,9.096680226715659e7 +14541,2005-05-10,2016-12-18,11,1,2911,16676410,CVX,CHEVRON CORP NEW,,20440,1,16676410,1925-12-31,2022-12-30,2,1.818908058423171e8 +14541,2016-12-19,2021-03-31,11,1,1311,16676410,CVX,CHEVRON CORP NEW,,20440,1,16676410,1925-12-31,2022-12-30,2,2.0752034995633858e8 +14541,2021-04-01,2022-12-30,11,1,5541,16676410,CVX,CHEVRON CORP NEW,,20440,1,16676410,1925-12-31,2022-12-30,2,2.6491937668098018e8 +14763,2014-07-31,2022-12-30,11,1,2834,14880610,CTLT,CATALENT INC,,54931,1,14880610,2014-07-31,2022-12-30,2,8.686231049027149e6 +15202,1925-12-31,1957-01-01,11,1,3350,,,VULCAN DETINNING CO,,21876,1,92916010,1925-12-31,2022-12-30,2,3138.8368988484985 +15202,1957-01-02,1962-07-01,11,1,3350,,,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,21823.16013367052 +15202,1962-07-02,1968-01-01,11,1,3272,,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,87096.98041516246 +15202,1968-01-02,1978-04-02,11,1,3272,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,166064.1429094996 +15202,1978-04-03,2001-08-23,11,1,2869,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,1.7487189937557443e6 +15202,2001-08-24,2011-06-15,11,1,1422,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,6.082924464401936e6 +15202,2011-06-16,2017-12-25,11,1,1442,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,1.0058217534298284e7 +15202,2017-12-26,2021-03-31,11,1,1422,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,1.6838911664706927e7 +15202,2021-04-01,2022-12-30,11,1,1423,92916010,VMC,VULCAN MATERIALS CO,,21876,1,92916010,1925-12-31,2022-12-30,2,2.3459062066433072e7 +15291,2015-04-16,2022-12-30,11,3,9999,29786A10,ETSY,ETSY INC,,55229,3,29786A10,2015-04-16,2022-12-30,2,8.86439127868835e6 +15720,1926-05-27,1962-07-01,11,1,4910,,,SOUTHERN CALIFORNIA EDISON CO,,21543,1,28102010,1926-05-27,2022-12-30,2,179660.60397041508 +15720,1962-07-02,1968-01-01,11,1,4911,,SCE,SOUTHERN CALIFORNIA EDISON CO,,21543,1,28102010,1926-05-27,2022-12-30,2,1.2634417270758122e6 +15720,1968-01-02,1988-06-30,11,1,4911,84240010,SCE,SOUTHERN CALIFORNIA EDISON CO,,21543,1,28102010,1926-05-27,2022-12-30,2,2.5255653970588236e6 +15720,1988-07-01,1996-02-04,11,1,4911,78388210,SCE,S C E CORP,,21543,1,28102010,1926-05-27,2022-12-30,2,8.360719654637832e6 +15720,1996-02-05,2001-01-31,11,1,4931,28102010,EIX,EDISON INTERNATIONAL,,21543,1,28102010,1926-05-27,2022-12-30,2,8.770588702565929e6 +15720,2001-02-01,2022-12-30,11,1,4911,28102010,EIX,EDISON INTERNATIONAL,,21543,1,28102010,1926-05-27,2022-12-30,2,1.5726969090306316e7 +16538,2017-01-17,2017-10-23,12,1,3533,G8711010,FTI,TECHNIPFMC PLC,,55833,1,G8711010,2017-01-17,2022-12-30,2,1.3798431678259395e7 +16538,2017-10-24,2022-12-30,12,1,1389,G8711010,FTI,TECHNIPFMC PLC,,55833,1,G8711010,2017-01-17,2022-12-30,2,7.3454042671366045e6 +16600,1927-12-01,1962-07-01,11,1,2070,,,HERSHEY CHOCOLATE CORP,,20906,1,42786610,1927-12-01,2022-12-30,2,84174.41013454414 +16600,1962-07-02,1968-01-29,11,1,2066,,HSY,HERSHEY CHOCOLATE CORP,,20906,1,42786610,1927-12-01,2022-12-30,2,385829.4728647687 +16600,1968-01-30,2005-04-19,11,1,2066,42786610,HSY,HERSHEY FOODS CORP,,20906,1,42786610,1927-12-01,2022-12-30,2,2.7160994749010345e6 +16600,2005-04-20,2022-12-30,11,1,2066,42786610,HSY,HERSHEY CO,,20906,1,42786610,1927-12-01,2022-12-30,2,1.4400883580930548e7 +16851,2017-09-01,2019-06-02,11,1,2821,26078J10,DWDP,DOWDUPONT INC,,56027,1,26614N10,2017-09-01,2022-12-30,2,1.4353456104157192e8 +16851,2019-06-03,2020-03-25,11,1,5191,26614N10,DD,DUPONT DE NEMOURS INC,,56027,1,26614N10,2017-09-01,2022-12-30,2,4.731719866983005e7 +16851,2020-03-26,2022-12-30,11,1,2821,26614N10,DD,DUPONT DE NEMOURS INC,,56027,1,26614N10,2017-09-01,2022-12-30,2,3.866780671503806e7 +17005,1928-09-27,1962-07-01,11,1,5660,,,MELVILLE SHOE CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,42865.34042426959 +17005,1962-07-02,1968-01-01,11,1,3143,,MES,MELVILLE SHOE CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,87997.36534296029 +17005,1968-01-02,1976-04-13,11,1,3143,58578610,MES,MELVILLE SHOE CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,444299.8120155039 +17005,1976-04-14,1996-10-15,11,1,3143,58574510,MES,MELVILLE CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,2.800866753713349e6 +17005,1996-10-16,1996-11-20,11,1,3143,58574510,CVS,MELVILLE CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,4.090396e6 +17005,1996-11-21,1997-08-28,11,1,3143,12665010,CVS,C V S CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,5.815760008054123e6 +17005,1997-08-29,2007-03-21,11,1,5912,12665010,CVS,C V S CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,1.6956129864564184e7 +17005,2007-03-22,2014-09-03,11,1,5912,12665010,CVS,C V S CAREMARK CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,5.702571187838882e7 +17005,2014-09-04,2022-12-30,11,1,5912,12665010,CVS,C V S HEALTH CORP,,21185,1,12665010,1928-09-27,2022-12-30,2,9.661278594799036e7 +17144,1928-11-30,1962-07-01,11,1,2040,,,GENERAL MILLS INC,,20798,1,37033410,1928-11-30,2022-12-30,2,92841.32342541583 +17144,1962-07-02,1968-01-01,11,1,2043,,GIS,GENERAL MILLS INC,,20798,1,37033410,1928-11-30,2022-12-30,2,379334.6200361011 +17144,1968-01-02,2014-01-09,11,1,2043,37033410,GIS,GENERAL MILLS INC,,20798,1,37033410,1928-11-30,2022-12-30,2,9.063421793125931e6 +17144,2014-01-10,2021-04-04,11,1,2041,37033410,GIS,GENERAL MILLS INC,,20798,1,37033410,1928-11-30,2022-12-30,2,3.2870280506953973e7 +17144,2021-04-05,2022-12-30,11,1,2099,37033410,GIS,GENERAL MILLS INC,,20798,1,37033410,1928-11-30,2022-12-30,2,4.123838156162758e7 +17830,1929-04-11,1934-09-24,11,1,3720,,,UNITED AIRCRAFT & TRANS CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,76970.60683364255 +17830,1934-09-25,1962-07-01,11,1,3720,,,UNITED AIRCRAFT CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,141273.42244560993 +17830,1962-07-02,1968-01-01,11,1,3724,,UA,UNITED AIRCRAFT CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,599420.5166064982 +17830,1968-01-02,1975-04-30,11,1,3724,90929610,UA,UNITED AIRCRAFT CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,498589.50782107573 +17830,1975-05-01,2014-01-21,11,1,3724,91301710,UTX,UNITED TECHNOLOGIES CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,2.4627979347492803e7 +17830,2014-01-22,2015-05-20,11,1,3585,91301710,UTX,UNITED TECHNOLOGIES CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,1.039585736943206e8 +17830,2015-05-21,2016-12-07,11,1,3324,91301710,UTX,UNITED TECHNOLOGIES CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,8.662139720662192e7 +17830,2016-12-08,2020-04-02,11,1,3724,91301710,UTX,UNITED TECHNOLOGIES CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,1.0454943249385518e8 +17830,2020-04-03,2022-12-30,11,1,3724,75513E10,RTX,RAYTHEON TECHNOLOGIES CORP,,21832,1,75513E10,1929-04-11,2022-12-30,2,1.2110476298692137e8 +18428,2019-04-02,2019-12-22,11,1,6799,26055710,DOW,DOW INC,,56668,1,26055710,2019-04-02,2022-12-30,2,3.7462605217276365e7 +18428,2019-12-23,2022-12-30,11,1,2821,26055710,DOW,DOW INC,,56668,1,26055710,2019-04-02,2022-12-30,2,3.951559350965205e7 +19393,1933-09-08,1962-07-01,11,1,2830,,,BRISTOL MYERS CO,,20331,1,11012210,1933-09-08,2022-12-30,2,70160.73299769672 +19393,1962-07-02,1968-01-01,11,1,2830,,BMY,BRISTOL MYERS CO,,20331,1,11012210,1933-09-08,2022-12-30,2,969266.8542418772 +19393,1968-01-02,1972-05-31,11,1,2830,11009710,BMY,BRISTOL MYERS CO,,20331,1,11012210,1933-09-08,2022-12-30,2,1.8426176461397058e6 +19393,1972-06-01,1989-10-03,11,1,2844,11009710,BMY,BRISTOL MYERS CO,,20331,1,11012210,1933-09-08,2022-12-30,2,5.303951921564711e6 +19393,1989-10-04,1995-10-31,11,1,2844,11012210,BMY,BRISTOL MYERS SQUIBB CO,,20331,1,11012210,1933-09-08,2022-12-30,2,3.3533472247478854e7 +19393,1995-11-01,2022-12-30,11,1,2834,11012210,BMY,BRISTOL MYERS SQUIBB CO,,20331,1,11012210,1933-09-08,2022-12-30,2,8.19052308724631e7 +19807,2020-10-09,2022-12-30,11,1,3824,92888110,VNT,VONTIER CORP,,57315,1,92888110,2020-10-09,2022-12-30,2,4.722302724450249e6 +20057,2020-11-17,2022-12-30,11,3,9999,92556V10,VTRS,VIATRIS INC,,57529,3,92556V10,2020-11-17,2022-12-30,2,1.5841440075785788e7 +22111,1944-09-25,1962-07-01,11,1,3840,,,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,171667.11084129513 +22111,1962-07-02,1968-01-01,11,1,3842,,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,841868.948736462 +22111,1968-01-02,1998-11-30,11,1,3842,47816010,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,1.8621186546766605e7 +22111,1998-12-01,2006-03-15,11,1,2834,47816010,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,1.563245055455628e8 +22111,2006-03-16,2006-07-10,11,1,5000,47816010,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,1.785949931521534e8 +22111,2006-07-11,2021-12-20,11,1,2834,47816010,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,2.6765202758767614e8 +22111,2021-12-21,2022-12-30,11,1,3841,47816010,JNJ,JOHNSON & JOHNSON,,21018,1,47816010,1944-09-25,2022-12-30,2,4.5316371884940696e8 +22592,1946-01-14,1962-07-01,11,1,2640,,,MINNESOTA MINING & MFG CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,1.0717747134037532e6 +22592,1962-07-02,1968-01-01,11,1,2641,,MMM,MINNESOTA MINING & MFG CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,3.5630636936823106e6 +22592,1968-01-02,2001-08-23,11,1,2641,60405910,MMM,MINNESOTA MINING & MFG CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,1.537087617160573e7 +22592,2001-08-24,2002-04-07,11,1,2672,60405910,MMM,MINNESOTA MINING & MFG CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,4.3743165017522685e7 +22592,2002-04-08,2004-03-03,11,1,2672,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,5.25357008635292e7 +22592,2004-03-04,2006-04-09,11,1,2834,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,6.113367067326195e7 +22592,2006-04-10,2017-01-23,11,1,3841,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,7.031666547619946e7 +22592,2017-01-24,2020-10-22,11,1,5099,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,1.1134789870310853e8 +22592,2020-10-23,2022-07-04,11,1,3291,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,1.0097133839955616e8 +22592,2022-07-05,2022-12-30,11,1,3999,88579Y10,MMM,3M CO,,21205,1,88579Y10,1946-01-14,2022-12-30,2,7.136677274272579e7 +22752,1946-05-15,1962-07-01,11,1,2830,,,MERCK & CO INC,,21188,1,58933Y10,1946-05-15,2022-12-30,2,338485.99199057714 +22752,1962-07-02,1968-01-01,11,1,2831,,MRK,MERCK & CO INC,,21188,1,58933Y10,1946-05-15,2022-12-30,2,1.7524761207581228e6 +22752,1968-01-02,1999-01-03,11,1,2831,58933110,MRK,MERCK & CO INC,,21188,1,58933Y10,1946-05-15,2022-12-30,2,2.6205404123995163e7 +22752,1999-01-04,2008-05-05,11,1,2834,58933110,MRK,MERCK & CO INC,,21188,1,58933Y10,1946-05-15,2022-12-30,2,1.2166532714662747e8 +22752,2008-05-06,2009-11-03,11,1,2836,58933110,MRK,MERCK & CO INC,,21188,1,58933Y10,1946-05-15,2022-12-30,2,6.445694207159591e7 +22752,2009-11-04,2022-12-30,11,1,2834,58933Y10,MRK,MERCK & CO INC NEW,,21188,1,58933Y10,1946-05-15,2022-12-30,2,1.6444403919753486e8 +22779,1946-05-20,1947-05-04,11,1,3660,,,GALVIN MANUFACTURING CO,,21230,1,62007630,1946-05-20,2022-12-30,2,10216.506970260223 +22779,1947-05-05,1962-07-01,11,1,3660,,,MOTOROLA INC,,21230,1,62007630,1946-05-20,2022-12-30,2,107700.54630037783 +22779,1962-07-02,1968-01-01,11,1,3651,,MOT,MOTOROLA INC,,21230,1,62007630,1946-05-20,2022-12-30,2,566958.5860108304 +22779,1968-01-02,1996-07-31,11,1,3651,62007610,MOT,MOTOROLA INC,,21230,1,62007630,1946-05-20,2022-12-30,2,6.849107559937457e6 +22779,1996-08-01,2011-01-03,11,1,3663,62007610,MOT,MOTOROLA INC,,21230,1,62007630,1946-05-20,2022-12-30,2,3.752377100648084e7 +22779,2011-01-04,2017-01-11,11,1,3663,62007630,MSI,MOTOROLA SOLUTIONS INC,,21230,1,62007630,1946-05-20,2022-12-30,2,1.4647240354090447e7 +22779,2017-01-12,2021-03-31,11,1,3679,62007630,MSI,MOTOROLA SOLUTIONS INC,,21230,1,62007630,1946-05-20,2022-12-30,2,2.1822818406788696e7 +22779,2021-04-01,2022-12-30,11,1,3663,62007630,MSI,MOTOROLA SOLUTIONS INC,,21230,1,62007630,1946-05-20,2022-12-30,2,3.897218911999446e7 +23393,1976-12-30,1990-08-14,11,3,2812,17134010,CRCH,CHURCH & DWIGHT INC,,1103,1,17134010,1976-12-30,2022-12-30,2,151647.90318307202 +23393,1990-08-15,2022-12-30,11,1,2841,17134010,CHD,CHURCH & DWIGHT INC,,1103,1,17134010,1976-12-30,2022-12-30,2,5.921765977990483e6 +23660,1983-08-19,1999-06-30,11,3,7213,17290810,CTAS,CINTAS CORP,,6304,3,17290810,1983-08-19,2022-12-30,2,1.5130407932893177e6 +23660,1999-07-01,2022-12-30,11,3,2320,17290810,CTAS,CINTAS CORP,,6304,3,17290810,1983-08-19,2022-12-30,2,1.2040522297475178e7 +23819,1948-09-15,1960-07-05,11,1,1380,,,HALLIBURTON OIL WELL CEMENTING,,20868,1,40621610,1948-09-15,2022-12-30,2,134195.7250727214 +23819,1960-07-06,1962-07-01,11,1,1380,,,HALLIBURTON COMPANY,,20868,1,40621610,1948-09-15,2022-12-30,2,201995.0725 +23819,1962-07-02,1968-01-01,11,1,1389,,HAL,HALLIBURTON CO,,20868,1,40621610,1948-09-15,2022-12-30,2,319165.00333935017 +23819,1968-01-02,2022-12-30,11,1,1389,40621610,HAL,HALLIBURTON CO,,20868,1,40621610,1948-09-15,2022-12-30,2,1.4077780976629678e7 +24942,1952-09-15,1959-05-03,11,1,3660,,,RAYTHEON MANUFACTURING CO,,21492,1,75511150,1952-09-15,2020-04-02,2,56393.417192192195 +24942,1959-05-04,1962-07-01,11,1,3660,,,RAYTHEON CO,,21492,1,75511150,1952-09-15,2020-04-02,2,149779.54501254705 +24942,1962-07-02,1968-01-01,11,1,3671,,RTN,RAYTHEON CO,,21492,1,75511150,1952-09-15,2020-04-02,2,195822.7096570397 +24942,1968-01-02,1997-12-17,11,1,3671,75511110,RTN,RAYTHEON CO,,21492,1,75511150,1952-09-15,2020-04-02,2,3.8759946016650097e6 +24942,1997-12-18,2001-05-13,11,1,3812,75511140,RTN,RAYTHEON CO,B,21492,1,75511150,1952-09-15,2020-04-02,2,1.0304449995557068e7 +24942,2001-05-14,2020-04-02,11,1,3812,75511150,RTN,RAYTHEON CO,B,21492,1,75511150,1952-09-15,2020-04-02,2,2.681501109587003e7 +25081,1972-12-14,1973-06-06,11,3,0,25079310,DBKT,DETROIT BANK & TRUST CO,,1261,1,20034010,1972-12-14,2022-12-30,2,147489.14423076922 +25081,1973-06-07,1982-06-30,11,3,0,25145710,DBNK,DETROITBANK CORP,,1261,1,20034010,1972-12-14,2022-12-30,2,178944.15286276225 +25081,1982-07-01,1991-04-01,11,3,6711,20034010,CMCA,COMERICA INC,,1261,1,20034010,1972-12-14,2022-12-30,2,554722.6826683996 +25081,1991-04-02,1998-08-31,11,1,6712,20034010,CMA,COMERICA INC,,1261,1,20034010,1972-12-14,2022-12-30,2,4.535280351345949e6 +25081,1998-09-01,2022-12-30,11,1,6021,20034010,CMA,COMERICA INC,,1261,1,20034010,1972-12-14,2022-12-30,2,8.649874609910667e6 +25785,1956-03-07,1962-07-01,11,1,3710,,,FORD MOTOR CO,,20750,1,34537086,1956-03-07,2022-12-30,2,1.0317517537783375e6 +25785,1962-07-02,1968-01-01,11,1,3711,,F,FORD MOTOR CO DEL,,20750,1,34537086,1956-03-07,2022-12-30,2,2.7284308958483753e6 +25785,1968-01-02,2000-08-02,11,1,3711,34537010,F,FORD MOTOR CO DEL,,20750,1,34537086,1956-03-07,2022-12-30,2,1.6426883853290677e7 +25785,2000-08-03,2000-08-08,11,31,3711,34537086,F,FORD MOTOR CO DEL,,20750,1,34537086,1956-03-07,2022-12-30,2,5.1606681203125e7 +25785,2000-08-09,2022-12-30,11,1,3711,34537086,F,FORD MOTOR CO DEL,,20750,1,34537086,1956-03-07,2022-12-30,2,3.6976888863299645e7 +28484,1962-05-24,1962-07-01,11,1,2910,,,HESS OIL & CHEM CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,75831.07692307692 +28484,1962-07-02,1968-01-01,11,1,2911,,HES,HESS OIL & CHEM CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,148606.9202166065 +28484,1968-01-02,1969-06-22,11,1,2911,00428110,HES,HESS OIL & CHEM CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,524876.4231049563 +28484,1969-06-23,2006-05-08,11,1,2911,02355110,AHC,AMERADA HESS CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,3.2723848248895733e6 +28484,2006-05-09,2016-12-18,11,1,2911,42809H10,HES,HESS CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,2.1019181709004954e7 +28484,2016-12-19,2017-01-24,11,1,1311,42809H10,HES,HESS CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,1.939013397538026e7 +28484,2017-01-25,2017-03-09,11,1,1321,42809H10,HES,HESS CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,1.6556779529228702e7 +28484,2017-03-10,2022-12-30,11,1,1311,42809H10,HES,HESS CORP,,20064,1,42809H10,1962-05-24,2022-12-30,2,2.0840806681943256e7 +36468,1962-07-02,1964-02-10,11,2,2851,,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,212510.36265432098 +36468,1964-02-11,1968-01-01,11,1,2851,,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,262573.2705357143 +36468,1968-01-02,2004-02-19,11,1,2851,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,1.6728361488868855e6 +36468,2004-02-20,2014-01-30,11,1,5231,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,8.988309484106032e6 +36468,2014-01-31,2015-06-30,11,1,3272,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,2.296467392919935e7 +36468,2015-07-01,2017-06-11,11,1,5231,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,2.614758661011474e7 +36468,2017-06-12,2018-08-26,11,1,5198,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,3.63358377808966e7 +36468,2018-08-27,2022-12-30,11,1,2851,82434810,SHW,SHERWIN WILLIAMS CO,,21609,1,82434810,1962-07-02,2022-12-30,2,5.876537108556006e7 +37584,1983-09-23,1986-03-31,11,3,6711,35461310,FRRI,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,180324.72421259843 +37584,1986-04-01,1986-12-04,11,3,6210,35461310,FRRI,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,628119.6637931034 +37584,1986-12-05,2001-08-23,11,1,6281,35461310,BEN,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,4.540379458806755e6 +37584,2001-08-24,2004-02-16,11,1,6211,35461310,BEN,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,1.0115613534524865e7 +37584,2004-02-17,2014-01-07,11,1,6282,35461310,BEN,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,2.378656616700764e7 +37584,2014-01-08,2021-03-30,11,1,6722,35461310,BEN,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,2.1538657913234007e7 +37584,2021-03-31,2022-12-30,11,1,6282,35461310,BEN,FRANKLIN RESOURCES INC,,6407,1,35461310,1983-09-23,2022-12-30,2,1.4576701605672311e7 +38762,1962-12-19,1968-01-01,11,1,4911,,NI,NORTHERN INDIANA PUBLIC SVC CO,,21244,1,65473P10,1962-12-19,2022-12-30,2,524730.5538674033 +38762,1968-01-02,1988-03-03,11,1,4911,66526210,NI,NORTHERN INDIANA PUBLIC SVC CO,,21244,1,65473P10,1962-12-19,2022-12-30,2,565493.7511099053 +38762,1988-03-04,1999-04-14,11,1,4932,62914010,NI,N I P S C O INDUSTRIES INC,,21244,1,65473P10,1962-12-19,2022-12-30,2,1.953642858306624e6 +38762,1999-04-15,2001-08-23,11,1,4932,65473P10,NI,NISOURCE INC,,21244,1,65473P10,1962-12-19,2022-12-30,2,3.3328181914777355e6 +38762,2001-08-24,2017-12-25,11,1,4931,65473P10,NI,NISOURCE INC,,21244,1,65473P10,1962-12-19,2022-12-30,2,6.495352402019268e6 +38762,2017-12-26,2022-12-30,11,1,4939,65473P10,NI,NISOURCE INC,,21244,1,65473P10,1962-12-19,2022-12-30,2,9.97790655464277e6 +39917,1963-12-06,1968-01-01,11,1,2631,,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.2166256442682927e6 +39917,1968-01-02,2001-02-28,11,1,2631,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,5.671719137792106e6 +39917,2001-03-01,2004-02-08,11,1,2621,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.1989752685837155e7 +39917,2004-02-09,2005-08-08,11,1,2421,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.5062013158927333e7 +39917,2005-08-09,2010-01-03,11,1,2411,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.3110825328798428e7 +39917,2010-01-04,2011-06-12,18,1,2411,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,9.275893789402185e6 +39917,2011-06-13,2014-01-08,18,1,6798,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.3547507252364011e7 +39917,2014-01-09,2016-09-14,18,1,2499,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,1.823913400772479e7 +39917,2016-09-15,2017-01-10,18,1,6798,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,2.309890369593891e7 +39917,2017-01-11,2021-03-31,18,1,831,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,2.255718916638118e7 +39917,2021-04-01,2022-12-30,18,1,2435,96216610,WY,WEYERHAEUSER CO,,21914,1,96216610,1963-12-06,2022-12-30,2,2.694794494829346e7 +44206,1967-02-20,1968-01-01,11,1,4911,,NU,NORTHEAST UTILITIES,,21299,1,30040W10,1967-02-20,2022-12-30,2,587164.9573732719 +44206,1968-01-02,2015-02-18,11,1,4911,66439710,NU,NORTHEAST UTILITIES,,21299,1,30040W10,1967-02-20,2022-12-30,2,2.757243333515702e6 +44206,2015-02-19,2016-12-18,11,1,4911,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,1.6644845133070465e7 +44206,2016-12-19,2017-01-24,11,1,4932,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,1.7485242889767963e7 +44206,2017-01-25,2017-03-09,11,1,4911,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,1.7958304908398166e7 +44206,2017-03-10,2019-01-17,11,1,4932,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,1.9415808346782047e7 +44206,2019-01-18,2021-02-28,11,1,4911,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,2.7070719270755365e7 +44206,2021-03-01,2022-12-30,11,1,4924,30040W10,ES,EVERSOURCE ENERGY,,21299,1,30040W10,1967-02-20,2022-12-30,2,2.9420125629135493e7 +46703,1968-08-26,1993-10-11,11,1,5812,57163010,MHS,MARRIOTT CORP,,21157,3,44107P10,1968-08-26,2022-12-30,2,1.531299467023208e6 +46703,1993-10-12,1998-12-29,11,1,7011,44107810,HMT,HOST MARRIOTT CORP,,21157,3,44107P10,1968-08-26,2022-12-30,2,2.5115996191198784e6 +46703,1998-12-30,2006-04-17,18,1,6798,44107P10,HMT,HOST MARRIOTT CORP NEW,,21157,3,44107P10,1968-08-26,2022-12-30,2,3.454092937226395e6 +46703,2006-04-18,2006-06-29,18,1,6798,44107P10,HST,HOST HOTELS & RESORTS INC,,21157,3,44107P10,1968-08-26,2022-12-30,2,9.167353188210892e6 +46703,2006-06-30,2011-06-09,18,1,7011,44107P10,HST,HOST HOTELS & RESORTS INC,,21157,3,44107P10,1968-08-26,2022-12-30,2,9.159576563129755e6 +46703,2011-06-10,2020-11-01,18,1,6798,44107P10,HST,HOST HOTELS & RESORTS INC,,21157,3,44107P10,1968-08-26,2022-12-30,2,1.2958274877813242e7 +46703,2020-11-02,2022-12-30,18,3,6798,44107P10,HST,HOST HOTELS & RESORTS INC,,21157,3,44107P10,1968-08-26,2022-12-30,2,1.2111923912358386e7 +47896,1969-03-05,1988-04-25,11,1,6025,16379810,CHL,CHEMICAL NEW YORK CORP,,20436,1,46625H10,1969-03-05,2022-12-30,2,993432.4797870141 +47896,1988-04-26,1996-03-31,11,1,6025,16372210,CHL,CHEMICAL BANKING CORP,,20436,1,46625H10,1969-03-05,2022-12-30,2,6.427024505919741e6 +47896,1996-04-01,1996-06-02,11,1,6712,16161A10,CMB,CHASE MANHATTAN CORP NEW,,20436,1,46625H10,1969-03-05,2022-12-30,2,3.020479388372093e7 +47896,1996-06-03,2001-01-01,11,1,6021,16161A10,CMB,CHASE MANHATTAN CORP NEW,,20436,1,46625H10,1969-03-05,2022-12-30,2,5.3798757568388075e7 +47896,2001-01-02,2001-02-28,11,1,6021,46625H10,JPM,J P MORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.014548410621376e8 +47896,2001-03-01,2002-01-31,11,1,6712,46625H10,JPM,J P MORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,8.169136871890923e7 +47896,2002-02-01,2004-07-27,11,1,6021,46625H10,JPM,J P MORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,6.599568097237591e7 +47896,2004-07-28,2009-09-16,11,1,6021,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.417616928423804e8 +47896,2009-09-17,2010-01-28,11,1,6726,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.712695588355767e8 +47896,2010-01-29,2012-02-29,11,1,6712,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.5576238807918918e8 +47896,2012-03-01,2012-08-09,11,1,6021,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.4694212898217112e8 +47896,2012-08-10,2013-11-04,11,1,6211,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,1.8147636676700386e8 +47896,2013-11-05,2016-06-22,11,1,6021,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,2.2601359811490414e8 +47896,2016-06-23,2016-08-03,11,1,6099,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,2.290392507323415e8 +47896,2016-08-04,2022-12-30,11,1,6021,46625H10,JPM,JPMORGAN CHASE & CO,,20436,1,46625H10,1969-03-05,2022-12-30,2,3.667758925246185e8 +49373,1969-10-13,2001-08-23,11,1,7299,09367110,HRB,BLOCK H & R INC,,20309,1,09367110,1969-10-13,2022-12-30,2,1.7288976015382593e6 +49373,2001-08-24,2006-06-29,11,1,7291,09367110,HRB,BLOCK H & R INC,,20309,1,09367110,1969-10-13,2022-12-30,2,8.07440276724742e6 +49373,2006-06-30,2019-09-08,11,1,6159,09367110,HRB,BLOCK H & R INC,,20309,1,09367110,1969-10-13,2022-12-30,2,6.334298842651926e6 +49373,2019-09-09,2022-12-30,11,1,7291,09367110,HRB,BLOCK H & R INC,,20309,1,09367110,1969-10-13,2022-12-30,2,4.410727026614972e6 +51369,1970-10-19,1971-03-31,11,2,3823,88077010,TDY,TERADYNE INC,,21731,3,88077010,1970-10-19,2022-12-30,2,37926.67214912281 +51369,1971-04-01,1979-05-14,11,2,3823,88077010,TER,TERADYNE INC,,21731,3,88077010,1970-10-19,2022-12-30,2,48746.4543374817 +51369,1979-05-15,2002-01-01,11,1,3823,88077010,TER,TERADYNE INC,,21731,3,88077010,1970-10-19,2022-12-30,2,1.7175160674899411e6 +51369,2002-01-02,2018-11-26,11,1,3825,88077010,TER,TERADYNE INC,,21731,3,88077010,1970-10-19,2022-12-30,2,3.508884240911586e6 +51369,2018-11-27,2022-12-30,11,3,3825,88077010,TER,TERADYNE INC,,21731,3,88077010,1970-10-19,2022-12-30,2,1.4607604327423625e7 +52708,1971-06-23,1972-07-26,11,2,6552,52605710,LEN,LENNAR CORP,,21095,1,52605710,1971-06-23,2022-12-30,2,119174.15692446043 +52708,1972-07-27,2001-07-31,11,1,6552,52605710,LEN,LENNAR CORP,,21095,1,52605710,1971-06-23,2022-12-30,2,357763.2340334266 +52708,2001-08-01,2001-10-31,11,1,1531,52605710,LEN,LENNAR CORP,,21095,1,52605710,1971-06-23,2022-12-30,2,2.0703267099112214e6 +52708,2001-11-01,2003-04-20,11,1,1521,52605710,LEN,LENNAR CORP,,21095,1,52605710,1971-06-23,2022-12-30,2,2.866679114586053e6 +52708,2003-04-21,2006-07-23,11,1,1521,52605710,LEN,LENNAR CORP,A,21095,1,52605710,1971-06-23,2022-12-30,2,6.102839540654455e6 +52708,2006-07-24,2022-12-30,11,1,1531,52605710,LEN,LENNAR CORP,A,21095,1,52605710,1971-06-23,2022-12-30,2,9.54424199283198e6 +52978,1971-08-11,1984-09-09,11,2,3944,41805610,HAS,HASBRO INDUSTRIES INC,,20887,3,41805610,1971-08-11,2022-12-30,2,35573.46451832778 +52978,1984-09-10,1985-06-05,11,2,3944,41805610,HAS,HASBRO BRADLEY INC,,20887,3,41805610,1971-08-11,2022-12-30,2,602070.2553475936 +52978,1985-06-06,1999-06-22,11,2,3944,41805610,HAS,HASBRO INC,,20887,3,41805610,1971-08-11,2022-12-30,2,2.312485975486052e6 +52978,1999-06-23,2010-12-20,11,1,3944,41805610,HAS,HASBRO INC,,20887,3,41805610,1971-08-11,2022-12-30,2,3.6366617206446268e6 +52978,2010-12-21,2022-12-30,11,3,3944,41805610,HAS,HASBRO INC,,20887,3,41805610,1971-08-11,2022-12-30,2,9.517065219527733e6 +57665,1980-12-02,1986-03-31,11,3,3149,65410610,NIKE,NIKE INC,B,3194,1,65410610,1980-12-02,2022-12-30,2,213049.93889301634 +57665,1986-04-01,1989-04-02,11,3,5690,65410610,NIKE,NIKE INC,B,3194,1,65410610,1980-12-02,2022-12-30,2,470500.87763157894 +57665,1989-04-03,1990-10-16,11,3,5130,65410610,NIKE,NIKE INC,B,3194,1,65410610,1980-12-02,2022-12-30,2,1.3743613670076726e6 +57665,1990-10-17,1999-01-03,11,1,5139,65410610,NKE,NIKE INC,B,3194,1,65410610,1980-12-02,2022-12-30,2,5.345962816596385e6 +57665,1999-01-04,2022-12-30,11,1,3021,65410610,NKE,NIKE INC,B,3194,1,65410610,1980-12-02,2022-12-30,2,5.239375096183783e7 +57904,1973-08-23,1974-06-13,11,3,0,02587010,AFAC,AMERICAN FAMILY CORP,,92,1,00105510,1973-08-23,2022-12-30,2,48938.979166666664 +57904,1974-06-14,1992-01-01,11,1,6321,02587010,AFL,AMERICAN FAMILY CORP,,92,1,00105510,1973-08-23,2022-12-30,2,580939.4110121732 +57904,1992-01-02,2022-12-30,11,1,6321,00105510,AFL,AFLAC INC,,92,1,00105510,1973-08-23,2022-12-30,2,2.02036341643289e7 +59300,1980-02-11,1984-12-30,48,3,0,67959210,ODRES,OLD DOMINION REAL ESTATE INVT TR,,3334,1,90265310,1980-02-11,2022-12-30,2,10109.280993852459 +59300,1984-12-31,1985-01-01,18,3,6799,91019710,ODRE,UNITED DOMINION REALTY TR INC,,3334,1,90265310,1980-02-11,2022-12-30,2,43827.0625 +59300,1985-01-02,1990-05-06,18,3,6799,91019710,UDRT,UNITED DOMINION REALTY TR INC,,3334,1,90265310,1980-02-11,2022-12-30,2,107800.29027777778 +59300,1990-05-07,1994-06-30,18,1,6512,91019710,UDR,UNITED DOMINION REALTY TR INC,,3334,1,90265310,1980-02-11,2022-12-30,2,359105.3177925785 +59300,1994-07-01,2007-03-14,18,1,6798,91019710,UDR,UNITED DOMINION REALTY TR INC,,3334,1,90265310,1980-02-11,2022-12-30,2,1.7192944737397716e6 +59300,2007-03-15,2022-12-30,18,1,6798,90265310,UDR,U D R INC,,3334,1,90265310,1980-02-11,2022-12-30,2,8.077048363437006e6 +59328,1972-12-14,2022-12-30,11,3,3679,45814010,INTC,INTEL CORP,,2367,3,45814010,1972-12-14,2022-12-30,2,9.107811360624333e7 +60986,1972-12-14,1979-06-27,11,3,2591,65119210,NEWL,NEWELL COMPANIES INC,,3178,3,65122910,1972-12-14,2022-12-30,2,28594.952471194665 +60986,1979-06-28,1985-05-21,11,1,2591,65119210,NWL,NEWELL COMPANIES INC,,3178,3,65122910,1972-12-14,2022-12-30,2,82034.05726373995 +60986,1985-05-22,1997-05-29,11,1,2591,65119210,NWL,NEWELL CO,,3178,3,65122910,1972-12-14,2022-12-30,2,2.164538139149391e6 +60986,1997-05-30,1999-03-23,11,1,7363,65119210,NWL,NEWELL CO,,3178,3,65122910,1972-12-14,2022-12-30,2,7.027838581646608e6 +60986,1999-03-24,2004-02-19,11,1,3221,65122910,NWL,NEWELL RUBBERMAID INC,,3178,3,65122910,1972-12-14,2022-12-30,2,7.8739734457019875e6 +60986,2004-02-20,2016-04-17,11,1,3089,65122910,NWL,NEWELL RUBBERMAID INC,,3178,3,65122910,1972-12-14,2022-12-30,2,6.65367267050364e6 +60986,2016-04-18,2018-12-10,11,1,3089,65122910,NWL,NEWELL BRANDS INC,,3178,3,65122910,1972-12-14,2022-12-30,2,1.859338918371882e7 +60986,2018-12-11,2022-12-30,11,3,3089,65122910,NWL,NEWELL BRANDS INC,,3178,3,65122910,1972-12-14,2022-12-30,2,8.278234115382351e6 +61399,1972-12-14,1979-12-18,11,3,0,54866110,LOWE,LOWES COMPANIES INC,,2709,1,54866110,1972-12-14,2022-12-30,2,332512.7290960452 +61399,1979-12-19,2001-08-23,11,1,5031,54866110,LOW,LOWES COMPANIES INC,,2709,1,54866110,1972-12-14,2022-12-30,2,4.756865290464852e6 +61399,2001-08-24,2022-12-30,11,1,5211,54866110,LOW,LOWES COMPANIES INC,,2709,1,54866110,1972-12-14,2022-12-30,2,5.9109768581020735e7 +61516,1980-02-27,1998-04-30,11,2,2821,09057220,BIO,BIO RAD LABORATORIES INC,A,655,1,09057220,1980-02-27,2022-12-30,2,108558.54125408053 +61516,1998-05-01,2001-07-01,11,2,3826,09057220,BIO,BIO RAD LABORATORIES INC,A,655,1,09057220,1980-02-27,2022-12-30,2,277217.7065052133 +61516,2001-07-02,2008-10-23,11,2,8731,09057220,BIO,BIO RAD LABORATORIES INC,A,655,1,09057220,1980-02-27,2022-12-30,2,1.269782056700009e6 +61516,2008-10-24,2010-12-28,11,1,8731,09057220,BIO,BIO RAD LABORATORIES INC,A,655,1,09057220,1980-02-27,2022-12-30,2,1.9060124050402746e6 +61516,2010-12-29,2022-12-30,11,1,3826,09057220,BIO,BIO RAD LABORATORIES INC,A,655,1,09057220,1980-02-27,2022-12-30,2,6.525692207971026e6 +61621,1983-08-26,1999-06-30,11,3,8931,70432610,PAYX,PAYCHEX INC,,6333,3,70432610,1983-08-26,2022-12-30,2,1.4666921108032593e6 +61621,1999-07-01,2022-12-30,11,3,8700,70432610,PAYX,PAYCHEX INC,,6333,3,70432610,1983-08-26,2022-12-30,2,1.789132918155597e7 +61735,1980-06-02,1987-04-23,11,1,6411,20016610,PMA,COMBINED INTL CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,1.0523523369908205e6 +61735,1987-04-24,1998-08-02,11,1,6311,03738910,AOC,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,3.8717795271929824e6 +61735,1998-08-03,2001-01-01,11,1,6321,03738910,AOC,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,9.22722191045082e6 +61735,2001-01-02,2004-02-16,11,1,6311,03738910,AOC,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,7.894845069266076e6 +61735,2004-02-17,2009-11-30,11,1,6321,03738910,AOC,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,1.0815172111309245e7 +61735,2009-12-01,2011-06-09,11,1,6321,03738910,AON,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,1.2788251376914462e7 +61735,2011-06-10,2012-04-01,11,1,6411,03738910,AON,AON CORP,,20203,1,G0403H10,1980-06-02,2022-12-30,2,1.5327827932799695e7 +61735,2012-04-02,2014-01-07,12,1,6411,G0408V10,AON,AON PLC,A,20203,1,G0403H10,1980-06-02,2022-12-30,2,1.9071487301540177e7 +61735,2014-01-08,2014-11-23,12,1,6722,G0408V10,AON,AON PLC,A,20203,1,G0403H10,1980-06-02,2022-12-30,2,2.534346470507321e7 +61735,2014-11-24,2020-03-31,12,1,6411,G0408V10,AON,AON PLC,A,20203,1,G0403H10,1980-06-02,2022-12-30,2,3.425653857856566e7 +61735,2020-04-01,2022-12-30,12,1,6411,G0403H10,AON,AON PLC NEW,A,20203,1,G0403H10,1980-06-02,2022-12-30,2,5.589576007024317e7 +66800,1972-12-14,1984-10-09,11,3,6711,02687410,AIGR,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,2.2842086149254357e6 +66800,1984-10-10,2001-01-01,11,1,6711,02687410,AIG,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,4.5237675694249235e7 +66800,2001-01-02,2009-06-30,11,1,6331,02687410,AIG,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,1.5007355889315084e8 +66800,2009-07-01,2016-12-18,11,1,6331,02687478,AIG,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,5.324623196229895e7 +66800,2016-12-19,2021-04-04,11,1,6399,02687478,AIG,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,4.459000227867813e7 +66800,2021-04-05,2022-12-30,11,1,6331,02687478,AIG,AMERICAN INTERNATIONAL GROUP INC,,137,1,02687478,1972-12-14,2022-12-30,2,4.515911798512484e7 +71563,1972-12-14,1986-03-31,11,3,6025,84344410,SNAT,SOUTHERN NATIONAL CORP NC,,4163,1,89832Q10,1972-12-14,2022-12-30,2,40760.03160447761 +71563,1986-04-01,1991-10-07,11,3,6710,84344410,SNAT,SOUTHERN NATIONAL CORP NC,,4163,1,89832Q10,1972-12-14,2022-12-30,2,226181.15891195417 +71563,1991-10-08,1997-05-18,11,1,6021,84344410,SNB,SOUTHERN NATIONAL CORP NC,,4163,1,89832Q10,1972-12-14,2022-12-30,2,1.5727669868305144e6 +71563,1997-05-19,1997-11-30,11,1,6021,05493710,BBK,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,5.978396408088235e6 +71563,1997-12-01,1998-08-02,11,1,2000,05493710,BBK,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,8.97324685751488e6 +71563,1998-08-03,1999-01-03,11,1,6021,05493710,BBK,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,9.826377920990566e6 +71563,1999-01-04,2001-01-01,11,1,6021,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,1.0711427079861112e7 +71563,2001-01-02,2002-01-01,11,1,6712,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,1.5288010634374535e7 +71563,2002-01-02,2004-02-16,11,1,6035,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,1.791479283316986e7 +71563,2004-02-17,2006-06-29,11,1,6021,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,2.1788236333934784e7 +71563,2006-06-30,2011-06-09,11,1,6029,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,1.862010586703746e7 +71563,2011-06-10,2016-10-10,11,1,6021,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,2.4525892652105927e7 +71563,2016-10-11,2019-09-26,11,1,6712,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,3.807396737611941e7 +71563,2019-09-27,2019-12-08,11,1,6021,05493710,BBT,B B & T CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,4.101868532995048e7 +71563,2019-12-09,2020-02-10,11,1,6021,89832Q10,TFC,TRUIST FINANCIAL CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,6.308156432214524e7 +71563,2020-02-11,2022-12-30,11,1,6712,89832Q10,TFC,TRUIST FINANCIAL CORP,,4163,1,89832Q10,1972-12-14,2022-12-30,2,6.6620900730389096e7 +75034,1987-04-24,2001-08-23,11,1,1389,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,4.8214379078513e6 +75034,2001-08-24,2005-03-01,11,1,3533,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,1.15222320924499e7 +75034,2005-03-02,2005-06-15,11,1,1000,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,1.5209298658828374e7 +75034,2005-06-16,2014-01-06,11,1,3533,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,2.0880751651938505e7 +75034,2014-01-07,2014-03-23,11,1,8741,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,2.602431465039503e7 +75034,2014-03-24,2017-07-04,11,1,3533,05722410,BHI,BAKER HUGHES INC,,20253,3,05722G10,1987-04-24,2022-12-30,2,2.473793256364913e7 +75034,2017-07-05,2019-10-17,11,1,3533,05722G10,BHGE,BAKER HUGHES INC NEW,A,20253,3,05722G10,1987-04-24,2022-12-30,2,1.3205029159041032e7 +75034,2019-10-18,2021-12-06,11,1,3533,05722G10,BKR,BAKER HUGHES CO,A,20253,3,05722G10,1987-04-24,2022-12-30,2,1.4414655296865728e7 +75034,2021-12-07,2022-12-30,11,3,3533,05722G10,BKR,BAKER HUGHES CO,A,20253,3,05722G10,1987-04-24,2022-12-30,2,2.8175543345772356e7 +75154,1987-07-24,1991-11-25,12,2,4411,14365810,CCL,CARNIVAL CRUISE LINES INC,A,20394,1,14365830,1987-07-24,2022-12-30,2,1.9014345551637853e6 +75154,1991-11-26,1994-04-24,12,1,7999,14365810,CCL,CARNIVAL CRUISE LINES INC,A,20394,1,14365830,1987-07-24,2022-12-30,2,4.033697407635468e6 +75154,1994-04-25,1998-06-14,12,1,7999,14365810,CCL,CARNIVAL CORP,A,20394,1,14365830,1987-07-24,2022-12-30,2,8.330887936303828e6 +75154,1998-06-15,1998-08-31,12,1,7999,14365810,CCL,CARNIVAL CORP,,20394,1,14365830,1987-07-24,2022-12-30,2,2.1786752395454545e7 +75154,1998-09-01,2003-04-20,12,1,4481,14365810,CCL,CARNIVAL CORP,,20394,1,14365830,1987-07-24,2022-12-30,2,1.8804270964193236e7 +75154,2003-04-21,2021-11-07,72,1,4481,14365830,CCL,CARNIVAL CORP,,20394,1,14365830,1987-07-24,2022-12-30,2,2.510270448166322e7 +75154,2021-11-08,2022-12-30,72,1,6719,14365830,CCL,CARNIVAL CORP,,20394,1,14365830,1987-07-24,2022-12-30,2,1.4338746244046697e7 +75825,1989-10-04,1999-09-14,11,1,1311,29356210,EOG,ENRON OIL & GAS CO,,22113,1,26875P10,1989-10-04,2022-12-30,2,2.8434357235624753e6 +75825,1999-09-15,2016-12-18,11,1,1311,26875P10,EOG,EOG RESOURCES INC,,22113,1,26875P10,1989-10-04,2022-12-30,2,2.2147188660680015e7 +75825,2016-12-19,2022-12-30,11,1,1382,26875P10,EOG,EOG RESOURCES INC,,22113,1,26875P10,1989-10-04,2022-12-30,2,5.246564685822185e7 +75828,1989-09-20,1991-09-26,11,3,7370,28551210,ERTS,ELECTRONIC ARTS,,10303,3,28551210,1989-09-20,2022-12-30,2,127390.2288405088 +75828,1991-09-27,2011-12-19,11,3,7370,28551210,ERTS,ELECTRONIC ARTS INC,,10303,3,28551210,1989-09-20,2022-12-30,2,7.055824623838329e6 +75828,2011-12-20,2022-12-30,11,3,7372,28551210,EA,ELECTRONIC ARTS INC,,10303,3,28551210,1989-09-20,2022-12-30,2,2.4617006947703734e7 +76185,1990-05-22,1999-05-19,11,1,2851,90218410,TYL,TYLER CORP DE,,26080,1,90225210,1990-05-22,2022-12-30,2,98779.10209524857 +76185,1999-05-20,2001-02-28,11,1,2851,90225210,TYL,TYLER TECHNOLOGIES INC,,26080,1,90225210,1990-05-22,2022-12-30,2,161078.9327127238 +76185,2001-03-01,2002-01-01,11,1,7379,90225210,TYL,TYLER TECHNOLOGIES INC,,26080,1,90225210,1990-05-22,2022-12-30,2,125099.34152817096 +76185,2002-01-02,2006-06-29,11,1,7373,90225210,TYL,TYLER TECHNOLOGIES INC,,26080,1,90225210,1990-05-22,2022-12-30,2,294298.4281015396 +76185,2006-06-30,2022-12-30,11,1,7372,90225210,TYL,TYLER TECHNOLOGIES INC,,26080,1,90225210,1990-05-22,2022-12-30,2,5.58356934380117e6 +76605,1991-04-02,1998-08-02,11,1,3799,05333210,AZO,AUTOZONE INC,,29009,1,05333210,1991-04-02,2022-12-30,2,3.474406734063342e6 +76605,1998-08-03,2001-08-23,11,1,5511,05333210,AZO,AUTOZONE INC,,29009,1,05333210,1991-04-02,2022-12-30,2,3.8619945783196483e6 +76605,2001-08-24,2006-06-29,11,1,5531,05333210,AZO,AUTOZONE INC,,29009,1,05333210,1991-04-02,2022-12-30,2,7.229040758388344e6 +76605,2006-06-30,2008-04-24,11,1,5013,05333210,AZO,AUTOZONE INC,,29009,1,05333210,1991-04-02,2022-12-30,2,7.987014904143219e6 +76605,2008-04-25,2022-12-30,11,1,5531,05333210,AZO,AUTOZONE INC,,29009,1,05333210,1991-04-02,2022-12-30,2,1.9810130045759946e7 +77129,1991-11-22,1997-09-01,18,1,6799,49446R10,KIM,KIMCO REALTY CORP,,29335,1,49446R10,1991-11-22,2022-12-30,2,762885.0350839617 +77129,1997-09-02,2022-12-30,18,1,6798,49446R10,KIM,KIMCO REALTY CORP,,29335,1,49446R10,1991-11-22,2022-12-30,2,6.967364084979411e6 +77338,1992-02-13,1996-10-31,11,3,3560,77669610,ROPR,ROPER INDUSTRIES INC NEW,,11344,1,77669610,1992-02-13,2022-12-30,2,399795.26800670015 +77338,1996-11-01,2011-06-12,11,1,3561,77669610,ROP,ROPER INDUSTRIES INC NEW,,11344,1,77669610,1992-02-13,2022-12-30,2,2.7318309809790356e6 +77338,2011-06-13,2015-04-28,11,1,3823,77669610,ROP,ROPER INDUSTRIES INC NEW,,11344,1,77669610,1992-02-13,2022-12-30,2,1.1905882193494137e7 +77338,2015-04-29,2022-12-30,11,1,3823,77669610,ROP,ROPER TECHNOLOGIES INC,,11344,1,77669610,1992-02-13,2022-12-30,2,3.2591037587616496e7 +77357,1992-02-26,2022-12-30,11,3,7370,87160710,SNPS,SYNOPSYS INC,,11361,3,87160710,1992-02-26,2022-12-30,2,8.034536244091661e6 +77702,1992-06-26,1999-06-30,11,3,5490,85524410,SBUX,STARBUCKS CORP,,11592,3,85524410,1992-06-26,2022-12-30,2,2.0195329349590626e6 +77702,1999-07-01,2022-12-30,11,3,5810,85524410,SBUX,STARBUCKS CORP,,11592,3,85524410,1992-06-26,2022-12-30,2,4.635400297010412e7 +78916,1993-02-17,1997-09-16,11,3,2830,94268310,WATS,WATSON PHARMACEUTICALS INC,,11965,1,G0177J10,1993-02-17,2020-05-08,2,913394.6631255393 +78916,1997-09-17,2013-01-23,11,1,2834,94268310,WPI,WATSON PHARMACEUTICALS INC,,11965,1,G0177J10,1993-02-17,2020-05-08,2,4.468774447788452e6 +78916,2013-01-24,2013-09-30,11,1,2834,00507K10,ACT,ACTAVIS INC,,11965,1,G0177J10,1993-02-17,2020-05-08,2,1.4901311046638312e7 +78916,2013-10-01,2015-06-14,12,1,2834,G0083B10,ACT,ACTAVIS PLC,,11965,1,G0177J10,1993-02-17,2020-05-08,2,5.763734288384504e7 +78916,2015-06-15,2020-05-08,12,1,2834,G0177J10,AGN,ALLERGAN PLC,,11965,1,G0177J10,1993-02-17,2020-05-08,2,7.479115272646943e7 +79145,1993-04-28,2011-06-15,12,1,4481,V7780T10,RCL,ROYAL CARIBBEAN CRUISES LTD,,29819,1,V7780T10,1993-04-28,2022-12-30,2,5.090854219883926e6 +79145,2011-06-16,2017-12-25,12,1,7011,V7780T10,RCL,ROYAL CARIBBEAN CRUISES LTD,,29819,1,V7780T10,1993-04-28,2022-12-30,2,1.3680491146407114e7 +79145,2017-12-26,2022-12-30,12,1,4481,V7780T10,RCL,ROYAL CARIBBEAN CRUISES LTD,,29819,1,V7780T10,1993-04-28,2022-12-30,2,1.9672794224708643e7 +79637,1981-07-09,1991-06-06,11,3,8060,91390310,UHSI,UNIVERSAL HEALTH SERVICES INC,B,4655,1,91390310,1981-07-09,2022-12-30,2,112658.93291284403 +79637,1991-06-07,2022-12-30,11,1,8062,91390310,UHS,UNIVERSAL HEALTH SERVICES INC,B,4655,1,91390310,1981-07-09,2022-12-30,2,4.404968615232743e6 +79782,1993-10-29,2001-02-11,18,1,6798,75893910,REG,REGENCY REALTY CORP,,30011,3,75884910,1993-10-29,2022-12-30,2,468295.3039105847 +79782,2001-02-12,2018-11-12,18,1,6798,75884910,REG,REGENCY CENTERS CORP,,30011,3,75884910,1993-10-29,2022-12-30,2,4.55620102395363e6 +79782,2018-11-13,2022-12-30,18,3,6798,75884910,REG,REGENCY CENTERS CORP,,30011,3,75884910,1993-10-29,2022-12-30,2,1.0168077938153422e7 +80381,1994-03-11,1996-07-31,18,1,1522,07201210,BYA,BAY APARTMENT COMMUNITIES INC,,30345,1,05348410,1994-03-11,2022-12-30,2,243433.34726821192 +80381,1996-08-01,1998-06-04,18,1,6798,07201210,BYA,BAY APARTMENT COMMUNITIES INC,,30345,1,05348410,1994-03-11,2022-12-30,2,758483.7825268817 +80381,1998-06-05,1998-10-04,18,1,6798,05337310,AVB,AVALON BAY COMMUNITIES INC,,30345,1,05348410,1994-03-11,2022-12-30,2,1.9470149996279762e6 +80381,1998-10-05,2022-12-30,18,1,6798,05348410,AVB,AVALONBAY COMMUNITIES INC,,30345,1,05348410,1994-03-11,2022-12-30,2,1.3547378324062958e7 +81061,1994-12-01,1995-01-02,11,1,5122,58155710,MKN,MCKESSON CORP NEW,,30521,1,58155Q10,1994-12-01,2022-12-30,2,1.394253375e6 +81061,1995-01-03,1999-01-12,11,1,5122,58155710,MCK,MCKESSON CORP NEW,,30521,1,58155Q10,1994-12-01,2022-12-30,2,3.650568478511788e6 +81061,1999-01-13,2017-01-25,11,1,5122,58155Q10,MCK,MCKESSON H B O C INC,,30521,1,58155Q10,1994-12-01,2022-12-30,2,1.9245078771987837e7 +81061,2017-01-26,2021-03-31,11,1,8099,58155Q10,MCK,MCKESSON H B O C INC,,30521,1,58155Q10,1994-12-01,2022-12-30,2,2.7669823730723456e7 +81061,2021-04-01,2022-12-30,11,1,5122,58155Q10,MCK,MCKESSON H B O C INC,,30521,1,58155Q10,1994-12-01,2022-12-30,2,4.101891350327183e7 +82303,1995-10-03,1996-05-27,11,1,6719,74435W10,RE,PRUDENTIAL REINSURANCE HOLD INC,,30970,1,G3223R10,1995-10-03,2022-12-30,2,1.112982456554878e6 +82303,1996-05-28,2000-02-23,11,1,6719,29980810,RE,EVEREST REINSURANCE HOLDINGS INC,,30970,1,G3223R10,1995-10-03,2022-12-30,2,1.6195288020502646e6 +82303,2000-02-24,2001-04-30,12,1,6719,G3223R10,RE,EVEREST RE GROUP LTD,,30970,1,G3223R10,1995-10-03,2022-12-30,2,2.177077100565187e6 +82303,2001-05-01,2006-06-29,12,1,6321,G3223R10,RE,EVEREST RE GROUP LTD,,30970,1,G3223R10,1995-10-03,2022-12-30,2,4.1809369693125356e6 +82303,2006-06-30,2022-12-30,12,1,6331,G3223R10,RE,EVEREST RE GROUP LTD,,30970,1,G3223R10,1995-10-03,2022-12-30,2,7.537927913862037e6 +82515,1995-10-13,2006-05-16,11,3,5090,78402810,POOL,S C P POOL CORP,,14046,3,73278L10,1995-10-13,2022-12-30,2,684627.0447504283 +82515,2006-05-17,2022-12-30,11,3,5090,73278L10,POOL,POOL CORP,,14046,3,73278L10,1995-10-13,2022-12-30,2,4.994426834043662e6 +83143,1996-02-01,1999-04-25,11,3,4220,46284P10,IMTN,IRON MOUNTAIN INC DEL,,14330,1,46284V10,1996-02-01,2022-12-30,2,487652.3237100737 +83143,1999-04-26,2000-02-01,11,1,4225,46284P10,IRM,IRON MOUNTAIN INC DEL,,14330,1,46284V10,1996-02-01,2022-12-30,2,1.0701216234056123e6 +83143,2000-02-02,2011-06-15,11,1,4225,46284610,IRM,IRON MOUNTAIN INC,,14330,1,46284V10,1996-02-01,2022-12-30,2,4.1455593399444288e6 +83143,2011-06-16,2014-07-10,11,1,8742,46284610,IRM,IRON MOUNTAIN INC,,14330,1,46284V10,1996-02-01,2022-12-30,2,5.790153447499462e6 +83143,2014-07-11,2015-01-20,11,1,4226,46284610,IRM,IRON MOUNTAIN INC,,14330,1,46284V10,1996-02-01,2022-12-30,2,7.029251441166211e6 +83143,2015-01-21,2016-09-18,18,1,6798,46284V10,IRM,IRON MOUNTAIN INC NEW,,14330,1,46284V10,1996-02-01,2022-12-30,2,7.433847417635378e6 +83143,2016-09-19,2017-06-07,18,1,4226,46284V10,IRM,IRON MOUNTAIN INC NEW,,14330,1,46284V10,1996-02-01,2022-12-30,2,9.15226034665426e6 +83143,2017-06-08,2017-12-25,18,1,6798,46284V10,IRM,IRON MOUNTAIN INC NEW,,14330,1,46284V10,1996-02-01,2022-12-30,2,1.007931253721657e7 +83143,2017-12-26,2022-12-30,18,1,4226,46284V10,IRM,IRON MOUNTAIN INC NEW,,14330,1,46284V10,1996-02-01,2022-12-30,2,1.0783906983489007e7 +84032,1996-10-29,2005-03-13,11,1,3533,63707110,NOI,NATIONAL OILWELL INC,,31769,1,62955J10,1996-10-29,2022-12-30,2,1.6612565969838311e6 +84032,2005-03-14,2021-01-03,11,1,3533,63707110,NOV,NATIONAL OILWELL VARCO INC,,31769,1,62955J10,1996-10-29,2022-12-30,2,1.85751807013457e7 +84032,2021-01-04,2022-12-30,11,1,3533,62955J10,NOV,N O V INC,,31769,1,62955J10,1996-10-29,2022-12-30,2,6.424953840492177e6 +84373,1997-01-14,2022-12-30,11,1,8071,74834L10,DGX,QUEST DIAGNOSTICS INC,,31838,1,74834L10,1997-01-14,2022-12-30,2,9.251038445068592e6 +84788,1997-05-15,2022-12-30,11,3,7370,02313510,AMZN,AMAZON COM INC,,15473,3,02313510,1997-05-15,2022-12-30,2,3.0324928309977704e8 +86964,1999-06-04,2001-07-01,11,3,3570,31561610,FFIV,F 5 NETWORKS INC,,16561,3,31561610,1999-06-04,2022-12-30,2,1.0542371842707633e6 +86964,2001-07-02,2021-11-15,11,3,7372,31561610,FFIV,F 5 NETWORKS INC,,16561,3,31561610,1999-06-04,2022-12-30,2,5.647925149049895e6 +86964,2021-11-16,2022-12-30,11,3,7372,31561610,FFIV,F 5 INC,,16561,3,31561610,1999-06-04,2022-12-30,2,1.0802777213400474e7 +86996,1999-06-16,2017-01-16,11,3,4890,78388J10,SBAC,S B A COMMUNICATIONS CORP,A,16584,3,78410G10,1999-06-16,2022-12-30,2,4.683982658274187e6 +86996,2017-01-17,2022-12-30,18,3,4899,78410G10,SBAC,S B A COMMUNICATIONS CORP NEW,A,16584,3,78410G10,1999-06-16,2022-12-30,2,2.689537463885441e7 +87445,1999-11-30,2022-12-30,11,1,8711,87936010,TDY,TELEDYNE TECHNOLOGIES,,36380,1,87936010,1999-11-30,2022-12-30,2,4.372876068851087e6 +87657,2000-04-03,2006-06-29,11,1,3841,28176E10,EW,EDWARDS LIFESCIENCES CORP,,36952,1,28176E10,2000-04-03,2022-12-30,2,1.8113925647144427e6 +87657,2006-06-30,2022-12-30,11,1,3842,28176E10,EW,EDWARDS LIFESCIENCES CORP,,36952,1,28176E10,2000-04-03,2022-12-30,2,2.1630445871144127e7 +89002,2001-06-08,2006-06-29,11,1,7374,01858110,ADS,ALLIANCE DATA SYSTEMS CORP,,41671,1,01858110,2001-06-08,2022-12-30,2,2.4162577649210696e6 +89002,2006-06-30,2014-01-07,11,1,7389,01858110,ADS,ALLIANCE DATA SYSTEMS CORP,,41671,1,01858110,2001-06-08,2022-12-30,2,5.198881194786328e6 +89002,2014-01-08,2021-03-30,11,1,7322,01858110,ADS,ALLIANCE DATA SYSTEMS CORP,,41671,1,01858110,2001-06-08,2022-12-30,2,1.1279390376983022e7 +89002,2021-03-31,2022-04-03,11,1,7323,01858110,ADS,ALLIANCE DATA SYSTEMS CORP,,41671,1,01858110,2001-06-08,2022-12-30,2,4.450008300976024e6 +89002,2022-04-04,2022-12-30,11,1,7323,01858110,BFH,BREAD FINANCIAL HOLDINGS INC,,41671,1,01858110,2001-06-08,2022-12-30,2,2.0898424142921327e6 +89017,2001-06-12,2010-01-03,12,1,6411,G9665510,WSH,WILLIS GROUP HOLDINGS LTD,,41694,3,G9662910,2001-06-12,2022-12-30,2,4.974357523826599e6 +89017,2010-01-04,2016-01-04,12,1,6411,G9666610,WSH,WILLIS GROUP HOLDINGS PUB LTD CO,,41694,3,G9662910,2001-06-12,2022-12-30,2,6.847202733225689e6 +89017,2016-01-05,2022-01-09,12,3,8742,G9662910,WLTW,WILLIS TOWERS WATSON PUB LTD CO,,41694,3,G9662910,2001-06-12,2022-12-30,2,2.254655055612381e7 +89017,2022-01-10,2022-12-30,12,3,8742,G9662910,WTW,WILLIS TOWERS WATSON PUB LTD CO,,41694,3,G9662910,2001-06-12,2022-12-30,2,2.4588014650828045e7 +89070,2001-08-07,2015-06-28,11,1,3842,98956P10,ZMH,ZIMMER HOLDINGS INC,,41870,1,98956P10,2001-08-07,2022-12-30,2,1.3831987954525655e7 +89070,2015-06-29,2022-12-30,11,1,3842,98956P10,ZBH,ZIMMER BIOMET HOLDINGS INC,,41870,1,98956P10,2001-08-07,2022-12-30,2,2.5472014460851543e7 +89269,2001-12-13,2003-10-15,11,3,6324,15135B10,CNTE,CENTENE CORP DEL,,42540,1,15135B10,2001-12-13,2022-12-30,2,327485.6643624563 +89269,2003-10-16,2022-12-30,11,1,6324,15135B10,CNC,CENTENE CORP DEL,,42540,1,15135B10,2001-12-13,2022-12-30,2,1.1437540028705744e7 +89626,2002-12-06,2004-03-04,11,1,6211,16776010,CME,CHICAGO MERCANTILE EXCH HLDG INC,A,43791,3,12572Q10,2002-12-06,2022-12-30,2,532158.5782677821 +89626,2004-03-05,2007-07-12,11,1,6231,16776010,CME,CHICAGO MERCANTILE EXCH HLDG INC,A,43791,3,12572Q10,2002-12-06,2022-12-30,2,1.1569637583663968e7 +89626,2007-07-13,2008-07-13,11,1,6231,12572Q10,CME,C M E GROUP INC,A,43791,3,12572Q10,2002-12-06,2022-12-30,2,2.7855516418384492e7 +89626,2008-07-14,2022-12-30,11,3,6200,12572Q10,CME,C M E GROUP INC,A,43791,3,12572Q10,2002-12-06,2022-12-30,2,4.006994129967352e7 +90038,2004-02-05,2015-06-30,11,1,6331,04621X10,AIZ,ASSURANT INC,,44893,1,04621X10,2004-02-05,2022-12-30,2,4.639288675919097e6 +90038,2015-07-01,2016-12-18,11,1,6321,04621X10,AIZ,ASSURANT INC,,44893,1,04621X10,2004-02-05,2022-12-30,2,5.216257376321983e6 +90038,2016-12-19,2020-10-12,11,1,6399,04621X10,AIZ,ASSURANT INC,,44893,1,04621X10,2004-02-05,2022-12-30,2,6.089379281041305e6 +90038,2020-10-13,2022-12-30,11,1,6411,04621X10,AIZ,ASSURANT INC,,44893,1,04621X10,2004-02-05,2022-12-30,2,8.829178680554766e6 +90373,2004-10-29,2022-12-30,18,1,6798,25386810,DLR,DIGITAL REALTY TRUST INC,,45684,1,25386810,2004-10-29,2022-12-30,2,1.3684091570336659e7 +90386,2004-10-25,2011-05-24,11,1,2874,61945A10,MOS,MOSAIC CO,,45695,1,61945C10,2004-10-25,2022-12-30,2,2.0374092447956827e7 +90386,2011-05-25,2022-12-30,11,1,2874,61945C10,MOS,MOSAIC CO NEW,,45695,1,61945C10,2004-10-25,2022-12-30,2,1.2860314497609813e7 +90454,2004-11-05,2022-12-30,11,3,6211,57060D10,MKTX,MARKETAXESS HLDGS INC,,45878,3,57060D10,2004-11-05,2022-12-30,2,4.949072328070367e6 +90880,2005-10-03,2006-06-29,11,1,6282,03076C10,AMP,AMERIPRISE FINANCIAL INC,,47422,1,03076C10,2005-10-03,2022-12-30,2,1.0595904517195003e7 +90880,2006-06-30,2011-06-09,11,1,6141,03076C10,AMP,AMERIPRISE FINANCIAL INC,,47422,1,03076C10,2005-10-03,2022-12-30,2,1.094913947768786e7 +90880,2011-06-10,2022-12-30,11,1,6282,03076C10,AMP,AMERIPRISE FINANCIAL INC,,47422,1,03076C10,2005-10-03,2022-12-30,2,2.0374246660023905e7 +90993,2005-11-16,2006-06-29,11,1,6231,45865V10,ICE,INTERCONTINENTALEXCHANGE INC,,48793,1,45866F10,2005-11-16,2022-12-30,2,1.0068892917432478e6 +90993,2006-06-30,2013-11-12,11,1,6792,45865V10,ICE,INTERCONTINENTALEXCHANGE INC,,48793,1,45866F10,2005-11-16,2022-12-30,2,8.65138153420265e6 +90993,2013-11-13,2022-12-30,11,1,6231,45866F10,ICE,INTERCONTINENTALEXCHANGE GRP INC,,48793,1,45866F10,2005-11-16,2022-12-30,2,4.312059212938862e7 +91668,2006-12-13,2022-12-30,11,3,3674,44980X10,IPGP,I P G PHOTONICS CORP,,51555,3,44980X10,2006-12-13,2022-12-30,2,4.704178591958165e6 diff --git a/test/data/gvkey_cik_links.csv b/test/data/gvkey_cik_links.csv new file mode 100644 index 0000000..b3961ab --- /dev/null +++ b/test/data/gvkey_cik_links.csv @@ -0,0 +1,101 @@ +conm,gvkey,add1,add2,add3,add4,addzip,busdesc,cik,city,conml,costat,county,dlrsn,ein,fax,fic,fyrc,ggroup,gind,gsector,gsubind,idbflag,incorp,loc,naics,phone,prican,prirow,priusa,sic,spcindcd,spcseccd,spcsrc,state,stko,weburl,dldte,ipodate +HESS CORP,001380,"1185 Avenue of the Americas, 40th Floor",,,,10036,"Hess Corporation, an exploration and production company, explores, develops, produces, purchases, transports, and sells crude oil, natural gas liquids (NGLs), and natural gas. The company operates in two segments, Exploration and Production, and Midstream.",0000004447,New York,Hess Corp,A,,,13-4921002,,USA,12,1010,101020,10,10102020,D,DE,USA,2111,212 997 8500,01C,,01,1311,385,935,B-,NY,0,www.hess.com,, +AFLAC INC,001449,1932 Wynnton Road,,,,31999,"Aflac Incorporated, through its subsidiaries, provides supplemental health and life insurance products. It operates in two segments, Aflac Japan and Aflac U.S.",0000004977,Columbus,AFLAC Inc,A,,,58-1167100,,USA,12,4030,403010,40,40301020,B,GA,USA,524114,706 323 3431,,,01,6321,825,800,A-,GA,0,www.aflac.com,, +AMERICAN INTERNATIONAL GROUP,001487,1271 Avenue of the Americas,,,,10020,"American International Group, Inc. offers insurance products for commercial, institutional, and individual customers in North America and internationally. It operates through General Insurance, and Life and Retirement segments.",0000005272,New York,American International Group Inc,A,,,13-2592361,,USA,12,4030,403010,40,40301030,B,DE,USA,524126,212 770 7000,,,01,6331,830,800,B-,NY,0,www.aig.com,, +BAKER HUGHES INC,001976,17021 Aldine Westfield Road,,,,77073-5101,"Baker Hughes Holdings LLC operates as an energy technology company.The company was formerly known as Baker Hughes, a GE company, LLC and changed its name Baker Hughes Holdings LLC in April 2020. Baker Hughes Holdings LLC was incorporated in 1986 is based in Houston, Texas.",0000808362,Houston,Baker Hughes Inc,I,,01,76-0207995,,USA,12,1010,101010,10,10101020,B,DE,USA,213111,713 439 8600,,,01,1381,395,935,B-,TX,0,www.bakerhughes.com,2017-07-05, +BIO-RAD LABORATORIES INC,002220,1000 Alfred Nobel Drive,,,,94547,"Bio-Rad Laboratories, Inc. manufactures, and distributes life science research and clinical diagnostic products in the United States, Europe, Asia, Canada, and Latin America. The company operates through Life Science and Clinical Diagnostics segments.",0000012208,Hercules,Bio-Rad Laboratories Inc,A,,,94-1381833,510 741 5817,USA,12,3520,352030,35,35203010,D,DE,USA,334516,510 724 7000,,,01,3826,230,940,B,CA,0,www.bio-rad.com,, +BLOCK H & R INC,002269,One H&R Block Way,,,,64105,"H&R Block, Inc., through its subsidiaries, provides assisted income tax return preparation and do-it-yourself (DIY) tax return preparation services and products to the general public primarily in the United States, Canada, and Australia.",0000012659,Kansas City,Block H&R Inc,A,,,44-0607856,,USA,6,2530,253020,25,25302020,B,MO,USA,541213,816 854 3000,,,01,7200,175,976,B,MO,0,www.hrblock.com,, +BRISTOL-MYERS SQUIBB CO,002403,"430 East 29th Street, 14th Floor",,,,10016,"Bristol-Myers Squibb Company discovers, develops, licenses, manufactures, markets, distributes, and sells biopharmaceutical products worldwide. It offers products for hematology, oncology, cardiovascular, immunology, fibrotic, and neuroscience diseases.",0000014272,New York,Bristol-Myers Squibb Co,A,,,22-0790350,,USA,12,3520,352020,35,35202010,B,DE,USA,325412,212 546 4000,,,01,2834,280,905,B-,NY,0,www.bms.com,, +JPMORGAN CHASE & CO,002968,383 Madison Avenue,,,,10179,"JPMorgan Chase & Co. operates as a financial services company worldwide. It operates through four segments: Consumer & Community Banking (CCB), Corporate & Investment Bank (CIB), Commercial Banking (CB), and Asset & Wealth Management (AWM).",0000019617,New York,JPMorgan Chase & Co,A,,,13-2624428,,USA,12,4010,401010,40,40101010,B,DE,USA,522110,212 270 6000,,,01,6020,850,800,A-,NY,0,www.jpmorganchase.com,, +CHEVRON CORP,002991,6001 Bollinger Canyon Road,,,,94583-2324,"Chevron Corporation, through its subsidiaries, engages in the integrated energy and chemicals operations in the United States and internationally. The company operates in two segments, Upstream and Downstream.",0000093410,San Ramon,Chevron Corp,A,,,94-0890210,,USA,12,1010,101020,10,10102010,B,DE,USA,324110,925 842 1000,,,01,2911,390,935,B-,CA,0,www.chevron.com,, +CHURCH & DWIGHT INC,003026,"Princeton South Corporate Center, 500 Charles Ewing Boulevar",,,,08628,"Church & Dwight Co., Inc. develops, manufactures, and markets household, personal care, and specialty products. It operates in three segments: Consumer Domestic, Consumer International, and Specialty Products Division.",0000313927,Ewing,Church & Dwight Co Inc,A,,,13-4996950,,USA,12,3030,303010,30,30301010,B,DE,USA,325611,609 806 1200,,,01,2840,320,978,A,NJ,0,churchdwight.com,, +CINTAS CORP,003062,"6800 Cintas Boulevard, PO Box 625737",,,,45262-5737,"Cintas Corporation provides corporate identity uniforms and related business services primarily in the United States, Canada, and Latin America. It operates through Uniform Rental and Facility Services, First Aid and Safety Services, and All Other segments.",0000723254,Cincinnati,Cintas Corp,A,,,31-1188630,,USA,5,2020,202010,20,20201070,D,WA,USA,812331,513 459 1200,,,01,7200,175,976,A+,OH,0,www.cintas.com,, +AON PLC,003221,"Metropolitan Building, James Joyce Street",,,,D01 K0Y8,"Aon plc, a professional services firm, provides advice and solutions to clients focused on risk, retirement, and health worldwide.",0000315293,Dublin,Aon plc,A,,,98-1539969,,IRL,12,4030,403010,40,40301010,B,,GBR,524210,353 1 266 6000,,,01,6411,330,800,B+,,0,www.aon.com,, +COMERICA INC,003231,"Comerica Bank Tower, 1717 Main Street",,,,75201-6404,"Comerica Incorporated, through its subsidiaries, provides various financial products and services. The company operates through Commercial Bank, Retail Bank, Wealth Management, and Finance segments.",0000028412,Dallas,Comerica Incorporated,A,,,38-1998421,,USA,12,4010,401010,40,40101010,B,DE,USA,522110,214 462 6831,,,01,6020,817,800,A-,TX,0,www.comerica.com,, +DUPONT DE NEMOURS INC,004060,"Building 730, 974 Centre Road",,,,19805,"DuPont de Nemours, Inc. provides technology-based materials and solutions in the United States, Canada, the Asia Pacific, Latin America, Europe, the Middle East, and Africa. It operates through Electronics & Industrial, Water & Protection, and Corporate & Other segments.",0001666700,Wilmington,DuPont De Nemours Inc,A,,,81-1224539,,USA,12,1510,151010,15,15101050,B,DE,USA,334419,302 774 3034,,,01,3679,160,970,B-,DE,0,www.dupont.com,, +EATON CORP PLC,004199,"Eaton House, 30 Pembroke Road",,,,D04 Y0C2,Eaton Corporation plc operates as a power management company worldwide.,0001551182,Dublin,Eaton Corp Plc,A,,,98-1059235,,IRL,12,2010,201040,20,20104010,D,,IRL,335314,353 1 637 2900,,,01,3620,355,925,A-,,0,www.eaton.com,, +FORD MOTOR CO,004839,One American Road,,,,48126-1899,"Ford Motor Company develops, delivers, and services a range of Ford trucks, commercial cars and vans, sport utility vehicles, and Lincoln luxury vehicles worldwide. It operates through Ford Blue, Ford Model e, and Ford Pro; Ford Next; and Ford Credit segments.",0000037996,Dearborn,Ford Motor Co,A,,,38-0549190,,USA,12,2510,251020,25,25102010,B,DE,USA,33611,313 322 3000,,,01,3711,120,976,C,MI,0,www.ford.com,, +FRANKLIN RESOURCES INC,004885,One Franklin Parkway,,,,94403,"Franklin Resources, Inc. is a publicly owned asset management holding company. Through its subsidiaries, the firm provides its services to individuals, institutions, pension plans, trusts, and partnerships.",0000038777,San Mateo,Franklin Resources Inc,A,,,13-2670991,,USA,9,4020,402030,40,40203010,B,DE,USA,523940,650-312-2000,,,01,6282,823,800,B,CA,0,www.franklinresources.com,, +GENERAL DYNAMICS CORP,005046,11011 Sunset Hills Road,,,,20190,"General Dynamics Corporation operates as an aerospace and defense company worldwide. It operates through four segments: Aerospace, Marine Systems, Combat Systems, and Technologies.",0000040533,Reston,General Dynamics Corp,A,,,13-1673581,,USA,12,2010,201010,20,20101010,B,DE,USA,336411,703 876 3000,,,01,3721,110,925,A+,VA,0,www.gd.com,, +GENERAL MILLS INC,005071,Number One General Mills Boulevard,,,,55426,"General Mills, Inc. manufactures and markets branded consumer foods worldwide. The company operates in five segments: North America Retail; Convenience Stores & Foodservice; Europe & Australia; Asia & Latin America; and Pet.",0000040704,Minneapolis,General Mills Inc.,A,,,41-0274440,,USA,5,3020,302020,30,30202030,D,DE,USA,311230,763 764 7600,,,01,2040,250,978,A,MN,0,www.generalmills.com,, +GENERAL MOTORS CO,005073,300 Renaissance Center,,,,48265-3000,"General Motors Company designs, builds, and sells trucks, crossovers, cars, and automobile parts; and provide software-enabled services and subscriptions worldwide. The company operates through GM North America, GM International, Cruise, and GM Financial segments.",0001467858,Detroit,General Motors Co,A,,,27-0756180,,USA,12,2510,251020,25,25102010,B,DE,USA,336110,313 667 1500,19C,,19,3711,120,976,B,MI,0,www.gm.com,, +HALLIBURTON CO,005439,3000 North Sam Houston Parkway East,,,,77032,"Halliburton Company provides products and services to the energy industry worldwide. It operates in two segments, Completion and Production, and Drilling and Evaluation.",0000045012,Houston,Halliburton Co,A,,,75-2677995,,USA,12,1010,101010,10,10101020,D,DE,USA,213112,281 871 2699,,,01,1389,395,935,B-,TX,0,www.halliburton.com,, +HASBRO INC,005518,1027 Newport Avenue,,,,02861-1059,"Hasbro, Inc., together with its subsidiaries, operates as a play and entertainment company in the United States and internationally. The company operates through Consumer Products, Wizards of the Coast and Digital Gaming, and Entertainment segments.",0000046080,Pawtucket,Hasbro Inc.,A,,,05-0155090,,USA,12,2520,252020,25,25202010,D,RI,USA,339930,401 431 8697,,,01,3944,475,976,B+,RI,0,www.hasbro.com,, +HERSHEY CO,005597,19 East Chocolate Avenue,,,,17033,"The Hershey Company, together with its subsidiaries, engages in the manufacture and sale of confectionery products and pantry items in the United States and internationally. The company operates through three segments: North America Confectionery, North America Salty Snacks, and International.",0000047111,Hershey,Hershey Co (The),A,,,23-0691590,,USA,12,3020,302020,30,30202030,B,DE,USA,3113,717 534 4200,,,01,2060,250,978,A,PA,0,www.thehersheycompany.com,, +HILTON WORLDWIDE HOLDINGS,005643,"7930 Jones Branch Drive, Suite 1100",,,,22102,"Hilton Worldwide Holdings Inc., a hospitality company, engages in managing, franchising, owning, and leasing hotels and resorts. It operates through two segments, Management and Franchise, and Ownership. The company engages in the hotel management and licensing of its brands.",0001585689,McLean,Hilton Worldwide Holdings Inc,A,,,27-4384691,,USA,12,2530,253010,25,25301020,D,DE,USA,721110,703 883 1000,,,04,7011,310,976,B-,VA,0,www.hilton.com,, +INTEL CORP,006008,2200 Mission College Boulevard,,,,95054-1549,"Intel Corporation designs, develops, manufactures, markets, and sells computing and related products worldwide. It operates through Client Computing Group, Data Center and AI, Network and Edge, Mobileye, Accelerated Computing Systems and Graphics, Intel Foundry Services, and Other segments.",0000050863,Santa Clara,Intel Corp,A,,,94-1672743,,USA,12,4530,453010,45,45301020,B,DE,USA,334413,408 765 8080,,,01,3674,235,940,A-,CA,0,www.intel.com,, +JOHNSON & JOHNSON,006266,One Johnson & Johnson Plaza,,,,08933,"Johnson & Johnson, together with its subsidiaries, researches, develops, manufactures, and sells various products in the healthcare field worldwide. The company's Consumer Health segment provides skin health/beauty products under the AVEENO, CLEAN & CLEAR, DR.",0000200406,New Brunswick,Johnson & Johnson,A,,,22-1024240,,USA,12,3520,352020,35,35202010,B,NJ,USA,325412,732 524 0400,,,01,2834,280,905,B+,NJ,0,www.jnj.com,, +LENNAR CORP,006669,5505 Blue Lagoon Drive,,,,33126,"Lennar Corporation, together with its subsidiaries, operates as a homebuilder primarily under the Lennar brand in the United States. It operates through Homebuilding East, Homebuilding Central, Homebuilding Texas, Homebuilding West, Financial Services, Multifamily, and Lennar Other segments.",0000920760,Miami,Lennar Corp,A,,,95-4337490,,USA,11,2520,252010,25,25201030,D,DE,USA,236117,305 559 4000,,,01,1531,305,976,A,FL,0,www.lennar.com,, +LOWE'S COS INC,006829,1000 Lowe's Boulevard,,,,28117,"Lowe's Companies, Inc., together with its subsidiaries, operates as a home improvement retailer in the United States. The company offers a line of products for construction, maintenance, repair, remodeling, and decorating.",0000060667,Mooresville,Lowe's Cos Inc,A,,,56-0578072,,USA,1,2550,255040,25,25504030,D,NC,USA,444110,704 758 1000,,,01,5211,450,976,A,NC,0,www.lowes.com,, +HOST HOTELS & RESORTS INC,007063,"4747 Bethesda Avenue, Suite 1300",,,,20817,"Host Hotels & Resorts, Inc. is an S&P 500 company and is the largest lodging real estate investment trust and one of the largest owners of luxury and upper-upscale hotels.",0001070750,Bethesda,Host Hotels & Resorts Inc,A,,,53-0085950,,USA,12,6010,601030,60,60103010,D,MD,USA,531120,240-744-1000,,,01,6798,850,800,B-,MD,0,www.hosthotels.com,, +MCKESSON CORP,007171,6555 State Highway 161,,,,75039,"McKesson Corporation provides healthcare services in the United States and internationally. It operates through four segments: U.S. Pharmaceutical, International, Medical-Surgical Solutions, and Prescription Technology Solutions (RxTS). The U.S.",0000927653,Irving,McKesson Corp,A,,,94-3207296,,USA,3,3510,351020,35,35102010,D,DE,USA,424210,972 446 4800,,,01,5122,217,978,B,TX,0,www.mckesson.com,, +CVS HEALTH CORP,007241,One CVS Drive,,,,02895,"CVS Health Corporation provides health services in the United States. It operates through Health Care Benefits, Pharmacy Services, and Retail/LTC segments. The Health Care Benefits segment offers traditional, voluntary, and consumer-directed health insurance products and related services.",0000064803,Woonsocket,CVS Health Corp,A,,,05-0494040,,USA,12,3510,351020,35,35102015,B,DE,USA,621,401 765 1500,,,01,8000,435,978,A-,RI,0,www.cvshealth.com,, +MERCK & CO,007257,126 East Lincoln Avenue,,,,07065,"Merck & Co., Inc. operates as a healthcare company worldwide. It operates through two segments, Pharmaceutical and Animal Health.",0000310158,Rahway,Merck & Co Inc,A,,,22-1918501,,USA,12,3520,352020,35,35202010,B,NJ,USA,325412,908 740 4000,,,01,2834,285,905,B+,NJ,0,www.merck.com,, +3M CO,007435,3M Center,,,,55144-1000,3M Company provides diversified technology services in the United States and internationally. The company operates through four segments: Safety and Industrial; Transportation and Electronics; Health Care; and Consumer.,0000066740,Saint Paul,3M Co,A,,,41-0417775,,USA,12,2010,201050,20,20105010,B,DE,USA,322220,651 733 1110,,,01,2670,355,925,A,MN,0,www.3m.com,,1946-01-14 +MOTOROLA SOLUTIONS INC,007585,"500 West Monroe Street, Suite 4400",,,,60661,"Motorola Solutions, Inc. provides public safety and enterprise security solutions in the United States, the United Kingdom, Canada, and internationally. The company operates in two segments, Products and Systems Integration, and Software and Services.",0000068505,Chicago,Motorola Solutions Inc,A,,,36-1115800,,USA,12,4520,452010,45,45201020,B,DE,USA,334220,847 576 5000,,,01,3663,180,940,A-,IL,0,www.motorolasolutions.com,, +VIATRIS INC,007637,1000 Mylan Boulevard,,,,15317,"Viatris Inc. operates as a healthcare company worldwide. The company operates in four segments: Developed Markets, Greater China, JANZ, and Emerging Markets. It offers prescription brand drugs, generic drugs, complex generic drugs, biosimilars, and active pharmaceutical ingredients (APIs).",0001792044,Canonsburg,Viatris Inc,A,,,83-4364296,,USA,12,3520,352020,35,35202010,B,,USA,325412,724-514-1800,,,01,2834,283,905,C,PA,0,www.viatris.com,, +NEWELL BRANDS INC,007875,6655 Peachtree Dunwoody Road,,,,30328,"Newell Brands Inc. engages in the design, manufacture, sourcing, and distribution of consumer and commercial products worldwide. The company operates in five segments: Commercial Solutions, Home Appliances, Home Solutions, Learning and Development, and Outdoor and Recreation.",0000814453,Atlanta,Newell Brands Inc,A,,,36-3514169,,USA,12,2520,252010,25,25201050,D,DE,USA,3399,770 418 7000,,,01,3990,325,978,B-,GA,0,www.newellbrands.com,, +NIKE INC -CL B,007906,One Bowerman Drive,,,,97005-6453,"NIKE, Inc., together with its subsidiaries, designs, develops, markets, and sells men's, women's, and kids athletic footwear, apparel, equipment, and accessories worldwide.",0000320187,Beaverton,Nike Inc,A,,,93-0584541,,USA,5,2520,252030,25,25203020,B,OR,USA,316210,503 671 6453,,,01,3021,455,976,A-,OR,0,investors.nike.com,, +EVERSOURCE ENERGY,007970,300 Cadwell Drive,,,,01104,"Eversource Energy, a public utility holding company, engages in the energy delivery business. The company operates through Electric Distribution, Electric Transmission, Natural Gas Distribution, and Water Distribution segments.",0000072741,Springfield,Eversource Energy,A,,,04-2147929,,USA,12,5510,551010,55,55101010,B,MA,USA,2211,800 286 5000,,,01,4931,705,700,A,MA,0,www.eversource.com,, +NISOURCE INC,007974,801 East 86th Avenue,,,,46410,"NiSource Inc., an energy holding company, operates as a regulated natural gas and electric utility company in the United States. It operates through two segments, Gas Distribution Operations and Electric Operations.",0001111711,Merrillville,NiSource Inc,A,,,35-2108964,,USA,12,5510,551030,55,55103010,B,DE,USA,221210,877 647 5990,,,01,4932,710,700,B,IN,0,www.nisource.com,, +PAYCHEX INC,008402,911 Panorama Trail South,,,,14625-2396,"Paychex, Inc. provides integrated human capital management solutions for human resources (HR), payroll, benefits, and insurance services for small to medium-sized businesses in the United States, Europe, and India.",0000723531,Rochester,Paychex Inc.,A,,,16-1124166,,USA,5,2020,202020,20,20202010,D,DE,USA,541214,585 385 6666,,,01,8721,453,940,A+,NY,0,www.paychex.com,, +PENTAIR PLC,008463,"Regal House, 70 London Road, Twickenham",,,,TW13 QS,"Pentair plc provides various water solutions worldwide. The company operates through three segments: Pool, Water Solutions, Industrial & Flow Technologies.",0000077360,London,Pentair plc,A,,,98-1141328,,IRL,12,2010,201060,20,20106020,B,,GBR,333914,44 74 9421 6154,,,01,3561,355,925,B+,,0,www.pentair.com,, +CONOCOPHILLIPS,008549,925 North Eldridge Parkway,,,,77079-2703,"ConocoPhillips explores for, produces, transports, and markets crude oil, bitumen, natural gas, liquefied natural gas (LNG), and natural gas liquids in the United States and internationally.",0001163165,Houston,Conocophillips,A,,,01-0562944,,USA,12,1010,101020,10,10102020,B,DE,USA,2111,281 293 1000,01C,,01,1311,385,935,B,TX,0,www.conocophillips.com,, +RAYTHEON CO,008972,870 Winter Street,,,,02451-1449,"Raytheon Company develops technologically advanced and integrated products, services, and solutions for the defense and other government markets worldwide.",0001047122,Waltham,Raytheon Co.,I,,01,95-1778500,,USA,12,2010,201010,20,20101010,D,DE,USA,334511,781-522-3000,,,01,3812,225,940,A,MA,0,www.rtx.com,2020-04-04, +SHERWIN-WILLIAMS CO,009667,101 West Prospect Avenue,,,,44115-1075,"The Sherwin-Williams Company engages in the manufacture, distribution, and sale of paints, coating, and related products to professional, industrial, commercial, and retail customers. It operates through three segments: The Americas Group, Consumer Brands Group, and Performance Coatings Group.",0000089800,Cleveland,Sherwin-Williams Co (The),A,,,34-0526850,,USA,12,1510,151010,15,15101050,D,OH,USA,325510,216 566 2000,,,01,2851,450,976,A+,OH,0,www.sherwin-williams.com,, +EDISON INTERNATIONAL,009846,"2244 Walnut Grove Avenue, PO Box 976",,,,91770,"Edison International, through its subsidiaries, generates and distributes electric power. The company supplies electricity to approximately 50,000 square mile area of southern California to residential, commercial, industrial, public authorities, agricultural, and other sectors.",0000827052,Rosemead,Edison International,A,,,95-4137452,626 302 2117,USA,12,5510,551010,55,55101010,B,CA,USA,22111,626 302 2222,,,01,4911,705,700,B,CA,0,www.edison.com,, +TERADYNE INC,010453,600 Riverpark Drive,,,,01864,"Teradyne, Inc. designs, develops, manufactures, sells, and supports automatic test equipment worldwide. The company operates through Semiconductor Test, System Test, Industrial Automation, and Wireless Test segments.",0000097210,North Reading,Teradyne Inc,A,,,04-2272148,,USA,12,4530,453010,45,45301010,B,MA,USA,334515,978 370 2700,,,01,3825,247,940,B+,MA,0,www.teradyne.com,, +TYLER TECHNOLOGIES INC,010789,5101 Tennyson Parkway,,,,75024,"Tyler Technologies, Inc. provides integrated information management solutions and services for the public sector. It operates in two segments: Enterprise Software; and Platform Technologies.",0000860731,Plano,Tyler Technologies Inc,A,,,75-2303920,,USA,12,4510,451030,45,45103010,D,DE,USA,541512,972 713 3700,,,01,7373,454,940,B+,TX,0,www.tylertech.com,, +UDR INC,010894,"1745 Shea Center Drive, Suite 200",,,,80129,"UDR, Inc. (NYSE: UDR), an S&P 500 company, is a leading multifamily REIT with a demonstrated performance history of delivering superior and dependable returns by successfully managing, buying, selling, developing and redeveloping attractive real estate communities in targeted U.S. markets.",0000074208,Highlands Ranch,UDR Inc,A,,,54-0857512,720-283-2451,USA,12,6010,601060,60,60106010,D,MD,USA,531110,720-283-6120,,,01,6798,850,800,B,CO,0,www.udr.com,, +RAYTHEON TECHNOLOGIES CORP,010983,1000 Wilson Boulevard,,,,22209,"Raytheon Technologies Corporation, an aerospace and defense company, provides systems and services for the commercial, military, and government customers worldwide.",0000101829,Arlington,Raytheon Technologies Corp,A,,,06-0570975,,USA,12,2010,201010,20,20101010,D,DE,USA,336412,781 522 3000,,,01,3724,355,925,B+,VA,0,www.rtx.com,, +UNIVERSAL HEALTH SVCS INC,011032,"Universal Corporate Center, 367 South Gulph Road, PO Box 615",,,,19406-0958,"Universal Health Services, Inc., through its subsidiaries, owns and operates acute care hospitals, and outpatient and behavioral health care facilities. The company operates through Acute Care Hospital Services and Behavioral Health Care Services segments.",0000352915,King of Prussia,Universal Health Services Inc.,A,,,23-2077891,,USA,12,3510,351020,35,35102020,D,DE,USA,622110,610-768-3300,,,01,8062,295,905,A,PA,0,uhs.com,, +VULCAN MATERIALS CO,011228,1200 Urban Center Drive,,,,35242,"Vulcan Materials Company, together with its subsidiaries, produces and supplies construction aggregates primarily in the United States. It operates through four segments: Aggregates, Asphalt, Concrete, and Calcium.",0001396009,Birmingham,Vulcan Materials Co,A,,,20-8579133,,USA,12,1510,151020,15,15102010,D,NJ,USA,212319,205 298 3000,,,01,1400,202,970,B+,AL,0,www.vulcanmaterials.com,, +WEYERHAEUSER CO,011456,220 Occidental Avenue South,,,,98104,"Weyerhaeuser Company, one of the world's largest private owners of timberlands, began operations in 1900. We own or control approximately 11 million acres of timberlands in the U.S. and manage additional timberlands under long-term licenses in Canada.",0000106535,Seattle,Weyerhaeuser Co,A,,,91-0470860,,USA,12,6010,601080,60,60108040,D,WA,USA,321,206-539-3000,,,01,2400,400,970,B,WA,0,www.weyerhaeuser.com,, +TRUIST FINANCIAL CORP,011856,214 North Tryon Street,,,,28202,"Truist Financial Corporation, a holding company, provides banking and trust services in the Southeastern and Mid-Atlantic United States. The company operates through three segments: Consumer Banking and Wealth, Corporate and Commercial Banking, and Insurance Holdings.",0000092230,Charlotte,Truist Financial Corp,A,,,56-0939887,,USA,12,4010,401010,40,40101015,D,NC,USA,522110,336 733 2000,,,01,6020,815,800,B+,NC,0,www.truist.com,, +ORACLE CORP,012142,2300 Oracle Way,,,,78741,Oracle Corporation offers products and services that address enterprise information technology environments worldwide.,0001341439,Austin,Oracle Corp,A,,,54-2185193,,USA,5,4510,451030,45,45103020,B,DE,USA,519130,737 867 1000,,,01,7370,185,940,B+,TX,0,www.oracle.com,, +CARNIVAL CORPORATION & PLC,013498,"Carnival Place, 3655 N.W. 87th Avenue",,,,33178-2428,Carnival Corporation & plc engages in the provision of leisure travel services.,0000815097,Miami,Carnival Corporation & Plc,A,,,59-1562976,305 406 8630,PAN,11,2530,253010,25,25301020,B,,USA,483112,305 599 2600,,,01,4400,310,976,B-,FL,0,www.carnivalcorp.com,,1987-07-24 +ZOETIS INC,013721,10 Sylvan Way,,,,07054,"Zoetis Inc. discovers, develops, manufactures, and commercializes animal health medicines, vaccines, and diagnostic products in the United States and internationally.",0001555280,Parsippany,Zoetis Inc,A,,,46-0696167,,USA,12,3520,352020,35,35202010,B,DE,USA,325412,973 822 7000,,,01,2834,,,A,NJ,0,www.zoetis.com,,2013-02-01 +MAXIM INTEGRATED PRODUCTS,014256,160 Rio Robles,,,,95134,"Maxim Integrated Products, Inc. designs, develops, manufactures, and markets a range of linear and mixed-signal integrated circuits in the United States, China, rest of Asia, Europe, and internationally.",0000743316,San Jose,Maxim Integrated Products Inc.,I,,01,94-2896096,,USA,6,4530,453010,45,45301020,D,DE,USA,334413,408 601 1000,,,01,3674,235,940,B+,CA,0,www.maximintegrated.com,2021-08-27,1988-02-29 +FIRST REPUBLIC BANK,014275,"111 Pine Street, 2nd Floor",,,,94111,"First Republic Bank, together with its subsidiaries, provides private banking, private business banking, and private wealth management services to clients in metropolitan areas in the United States. It operates in two segments, Commercial Banking and Wealth Management.",0001132979,San Francisco,First Republic Bank,A,,,80-0513856,415 392 1413,USA,12,4010,401010,40,40101015,D,CA,USA,522110,415 392 1400,,,04,6020,840,800,A+,CA,0,www.firstrepublic.com,,1987-02-12 +ABBVIE INC,016101,1 North Waukegan Road,,,,60064-6400,"AbbVie Inc. discovers, develops, manufactures, and sells pharmaceuticals worldwide.",0001551152,North Chicago,AbbVie Inc,A,,,32-0375147,,USA,12,3520,352010,35,35201010,B,DE,USA,325414,847 932 7900,,,01,2836,,,A-,IL,0,www.abbvie.com,, +EOG RESOURCES INC,016478,"1111 Bagby Street, Sky Lobby 2",,,,77002,"EOG Resources, Inc., together with its subsidiaries, explores for, develops, produces, and markets crude oil, and natural gas and natural gas liquids. Its principal producing areas are in New Mexico and Texas in the United States; and the Republic of Trinidad and Tobago.",0000821189,Houston,EOG Resources Inc.,A,,,47-0684736,713 651 6995,USA,12,1010,101020,10,10102020,D,DE,USA,2111,713 651 7000,,,01,1311,380,935,B,TX,0,www.eogresources.com,, +ELECTRONIC ARTS INC,016721,209 Redwood Shores Parkway,,,,94065,"Electronic Arts Inc. develops, markets, publishes, and distributes games, content, and services for game consoles, PCs, mobile phones, and tablets worldwide.",0000712515,Redwood City,Electronic Arts Inc,A,,,94-2838567,,USA,3,5020,502020,50,50202020,B,DE,USA,511210,650 628 1500,,,01,7372,185,940,B,CA,0,ea.com,, +NEWS CORP,018043,1211 Avenue of the Americas,,,,10036,"News Corporation, a media and information services company, creates and distributes authoritative and engaging content, and other products and services for consumers and businesses worldwide.",0001564708,New York,News Corp,A,,,46-2950970,,USA,6,5020,502010,50,50201040,B,DE,USA,513110,212 416 3400,,,01,2711,,,B-,NY,0,newscorp.com,, +CATALENT INC,020228,14 Schoolhouse Road,,,,08873,"Catalent, Inc., together with its subsidiaries, develops and manufactures solutions for drugs, protein-based biologics, cell and gene therapies, and consumer health products worldwide.",0001596783,Somerset,Catalent Inc,A,,,20-8737688,732 537 6480,USA,6,3520,352020,35,35202010,D,DE,USA,325412,732 537 6200,,,01,2834,,,,NJ,0,www.catalent.com,,2014-07-31 +ETSY INC,023238,117 Adams Street,,,,11201,"Etsy, Inc., together with its subsidiaries, operates two-sided online marketplaces that connect buyers and sellers in the United States, the United Kingdom, Germany, Canada, Australia, France, and India.",0001370637,Brooklyn,Etsy Inc,A,,,20-4898921,,USA,12,2550,255030,25,25503030,D,DE,USA,519290,718 880 3660,,,01,7370,,,,NY,0,www.etsy.com,,2015-04-16 +AUTOZONE INC,023809,123 South Front Street,,,,38103,"AutoZone, Inc. retails and distributes automotive replacement parts and accessories. The company offers various products for cars, sport utility vehicles, vans, and light trucks, including new and remanufactured automotive hard parts, maintenance items, accessories, and non-automotive products.",0000866787,Memphis,AutoZone Inc,A,,,62-1482048,,USA,8,2550,255040,25,25504050,D,NV,USA,441330,901 495 6500,,,01,5531,449,976,B+,TN,0,www.autozone.com,,1991-04-01 +KIMCO REALTY CORP,024731,"500 North Broadway, Suite 201",,,,11753,"Kimco Realty Corp. (NYSE:KIM) is a real estate investment trust (REIT) headquartered in Jericho, N.Y. that is one of North America's largest publicly traded owners and operators of open-air, grocery-anchored shopping centers and mixed-use assets.",0000879101,Jericho,Kimco Realty Corp,A,,,13-2744380,,USA,12,6010,601070,60,60107010,D,MD,USA,531120,516-869-7235,,,01,6798,850,800,B,NY,0,www.kimcorealty.com,,1991-11-22 +ROPER TECHNOLOGIES INC,024925,"6901 Professional Parkway, Suite 200",,,,34240,"Roper Technologies, Inc. designs and develops software, and technology enabled products and solutions.",0000882835,Sarasota,Roper Technologies Inc,A,,,51-0263969,,USA,12,4510,451030,45,45103010,D,DE,USA,518210,941 556 2601,,,01,7370,357,925,A,FL,0,www.ropertech.com,,1992-02-12 +SYNOPSYS INC,024975,690 East Middlefield Road,,,,94043,"Synopsys, Inc. provides electronic design automation software products used to design and test integrated circuits.",0000883241,Mountain View,Synopsys Inc,A,,,56-1546236,,USA,10,4510,451030,45,45103010,D,DE,USA,511210,650 584 5000,,,01,7372,185,940,B+,CA,0,www.synopsys.com,,1992-02-26 +STARBUCKS CORP,025434,2401 Utah Avenue South,,,,98134,"Starbucks Corporation, together with its subsidiaries, operates as a roaster, marketer, and retailer of specialty coffee worldwide. The company operates through three segments: North America, International, and Channel Development.",0000829224,Seattle,Starbucks Corp,A,,,91-1325671,,USA,9,2530,253010,25,25301040,B,WA,USA,722513,206 447 1575,,,01,5812,420,978,B+,WA,0,www.starbucks.com,,1992-06-26 +ALLERGAN PLC,027845,"Clonshaugh Business and Technology Park, Coolock",,,,D17 E400,"Allergan plc, a pharmaceutical company, develops, manufactures, and commercializes branded pharmaceutical, device, biologic, surgical, and regenerative medicine products worldwide. The company operates in three segments: US Specialized Therapeutics, US General Medicine, and International.",0001578845,Dublin,Allergan PLC,I,,01,98-1114402,,IRL,12,3520,352020,35,35202010,B,,IRL,325412,,,,01,2834,283,905,B-,,0,www.allergan.com,2020-05-11,1993-02-17 +ROYAL CARIBBEAN GROUP,028191,1050 Caribbean Way,,,,33132-2096,"Royal Caribbean Cruises Ltd. operates as a cruise company worldwide. The company operates cruises under the Royal Caribbean International, Celebrity Cruises, and Silversea Cruises brands, which comprise a range of itineraries. As of February 13, 2023, it operated 64 ships.",0000884887,Miami,Royal Caribbean Group,A,,,98-0081645,305 539 0562,LBR,12,2530,253010,25,25301020,B,,USA,483112,305 539 6000,,,01,4400,612,600,B-,FL,0,www.rclinvestor.com,, +REGENCY CENTERS CORP,029099,"One Independent Drive, Suite 114",,,,32202,"Regency Centers is the preeminent national owner, operator, and developer of shopping centers located in affluent and densely populated trade areas.",0000910606,Jacksonville,Regency Centers Corp.,A,,,59-3191743,,USA,12,6010,601070,60,60107010,D,FL,USA,531120,904-598-7000,,,01,6798,850,800,B+,FL,0,www.regencycenters.com,,1993-10-29 +AVALONBAY COMMUNITIES INC,029875,"4040 Wilson Boulevard, Suite 1000",,,,22203,"As of December 31, 2020, the Company owned or held a direct or indirect ownership interest in 291 apartment communities containing 86,025 apartment homes in 11 states and the District of Columbia, of which 18 communities were under development and one community was under redevelopment.",0000915912,Arlington,AvalonBay Communities Inc.,A,,,77-0404318,,USA,12,6010,601060,60,60106010,D,MD,USA,531110,703-329-6300,,,01,6798,850,800,A-,VA,0,www.avalonbay.com,,1994-03-10 +TECHNIPFMC PLC,030923,"Hadrian House, Wincomblee Road",,,,NE6 3PL,"TechnipFMC plc engages in the oil and gas projects, technologies, and systems and services businesses in Europe, Central Asia, North and Latin America, the Asia Pacific, Africa, and the Middle East.",0001681459,Newcastle upon Tyne,TechnipFMC plc,A,,,98-1283037,,GBR,12,1010,101010,10,10101020,B,,GBR,237120,44 191 295 0303,,,01,1389,240,925,C,,0,www.technipfmc.com,, +BAKER HUGHES CO,032106,17021 Aldine Westfield Road,,,,77073-5101,Baker Hughes Company provides a portfolio of technologies and services to energy and industrial value chain worldwide. It operates through two segments: Oilfield Services & Equipment (OFSE) and Industrial & Energy Technology (IET).,0001701605,Houston,Baker Hughes a GE Co,A,,,81-4403168,,USA,12,1010,101010,10,10101020,D,DE,USA,213112,713 439 8600,,,01,1389,,,,TX,0,www.bakerhughes.com,, +DOW INC,034443,2211 H.H. Dow Way,,,,48674,"Dow Inc., through its subsidiaries, engages in the provision of various materials science solutions for packaging, infrastructure, mobility, and consumer applications in the United States, Canada, Europe, the Middle East, Africa, India, the Asia Pacific, and Latin America.",0001751788,Midland,Dow Inc,A,,,30-1128146,989 832 1456,USA,12,1510,151010,15,15101010,D,DE,USA,325211,989 636 1000,,,01,2821,,,,MI,0,www.dow.com,, +VONTIER CORP,036203,"5438 Wade Park Boulevard, Suite 600",,,,27607,"Vontier Corporation engages in the research and development, manufacture, sale, and distribution of technical equipment, components, software, and services for manufacturing, repairing, and servicing in the mobility ecosystem worldwide.",0001786842,Raleigh,Vontier Corp,A,,,84-2783455,,USA,12,4520,452030,45,45203010,D,DE,USA,334514,984 247 8308,,,01,3824,,,,NC,0,www.vontier.com,,2020-09-24 +EVEREST RE GROUP LTD,061388,"Seon Place, 4th Floor, 141 Front Street, PO Box HM 845",,,,HM 19,"Everest Re Group, Ltd., through its subsidiaries, provides reinsurance and insurance products in the United States, Bermuda, and internationally. The company operates through Reinsurance Operations and Insurance Operations segments.",0001095073,Hamilton,Everest Re Group Ltd,A,,,98-0365432,441 295 4828,BMU,12,4030,403010,40,40301050,B,,BMU,524130,,,,01,6331,835,800,B-,,0,www.everestre.com,,1995-10-02 +POOL CORP,061420,109 Northpark Boulevard,,,,70433-5001,"Pool Corporation distributes swimming pool supplies, equipment, and related leisure products in the United States and internationally.",0000945841,Covington,Pool Corp,A,,,36-3943363,,USA,12,2550,255010,25,25501010,D,DE,USA,423910,985 892 5521,,,01,5090,475,976,A+,LA,0,www.poolcorp.com,,1995-10-12 +IRON MOUNTAIN INC,062374,One Federal Street,,,,02110,"Iron Mountain Incorporated (NYSE: IRM), founded in 1951, is the global leader for storage and information management services.",0001020569,Boston,Iron Mountain Inc,A,,,23-2588479,,USA,12,6010,601080,60,60108010,B,DE,USA,531120,617-535-4766,,,01,6798,620,600,B,MA,0,www.ironmountain.com,,1996-01-31 +NOV INC,063892,10353 Richmond Avenue,,,,77042-4103,"NOV Inc. designs, constructs, manufactures, and sells systems, components, and products for oil and gas drilling and production, and industrial and renewable energy sectors worldwide.",0001021860,Houston,NOV Inc,A,,,76-0475815,,USA,12,1010,101010,10,10101020,B,DE,USA,333132,346 223 3000,,,01,3533,395,935,C,TX,0,www.nov.com,,1996-10-28 +QUEST DIAGNOSTICS INC,064166,500 Plaza Drive,,,,07094,"Quest Diagnostics Incorporated provides diagnostic testing, information, and services in the United States and internationally.",0001022079,Secaucus,Quest Diagnostics Inc,A,,,16-1387862,,USA,12,3510,351020,35,35102015,D,DE,USA,621511,973 520 2700,,,01,8071,292,905,A,NJ,0,www.questdiagnostics.com,,1996-12-17 +AMAZON.COM INC,064768,410 Terry Avenue North,,,,98109-5210,"Amazon.com, Inc. engages in the retail sale of consumer products and subscriptions through online and physical stores in North America and internationally. The company operates through three segments: North America, International, and Amazon Web Services (AWS).",0001018724,Seattle,Amazon.com Inc,A,,,91-1646860,,USA,12,2550,255030,25,25503030,B,DE,USA,454110,206 266 1000,,,01,5961,447,976,B,WA,0,www.amazon.com,,1997-05-15 +F5 INC,121077,801 5th Avenue,,,,98104-1663,"F5, Inc. provides multi-cloud application security and delivery solutions in the United States, Europe, the Middle East, Africa, and the Asia Pacific region.",0001048695,Seattle,F5 Inc,A,,,91-1714307,206 272 5556,USA,9,4520,452010,45,45201020,B,WA,USA,541512,206 272 5555,,,01,7373,454,940,B+,WA,0,www.f5.com,,1999-06-04 +SBA COMMUNICATIONS CORP,121382,8051 Congress Avenue,,,,33487,"SBA Communications Corporation is a first choice provider and leading owner and operator of wireless communications infrastructure in North, Central, and South America and South Africa.",0001034054,Boca Raton,SBA Communications Corp,A,,,65-0716501,,USA,12,6010,601080,60,60108030,B,FL,USA,531190,561-995-7670,,,01,6798,240,925,B-,FL,0,www.sbasite.com,,1999-06-16 +TELEDYNE TECHNOLOGIES INC,126721,1049 Camino Dos Rios,,,,91360-2362,"Teledyne Technologies Incorporated, together with its subsidiaries, provides enabling technologies for industrial growth markets in the United States, Canada, the United Kingdom, France, and internationally.",0001094285,Thousand Oaks,Teledyne Technologies Inc.,A,,,25-1843385,,USA,12,4520,452030,45,45203010,D,DE,USA,334511,805 373 4545,,,01,3812,110,925,B+,CA,0,www.teledyne.com,,1999-11-23 +EDWARDS LIFESCIENCES CORP,133366,One Edwards Way,,,,92614,"Edwards Lifesciences Corporation provides products and technologies for structural heart disease, and critical care and surgical monitoring in the United States, Europe, Japan, and internationally.",0001099800,Irvine,Edwards Lifesciences Corp,A,,,36-4316614,949 250 2525,USA,12,3510,351010,35,35101010,D,DE,USA,339113,949 250 2500,,,01,3842,300,905,B+,CA,0,www.edwards.com,,2000-03-27 +BREAD FINANCIAL HOLDINGS INC,143974,3095 Loyalty Circle,,,,43219,"Bread Financial Holdings, Inc. provides tech-forward payment and lending solutions to customers and consumer-based industries in North America.",0001101215,Columbus,Bread Financial Holdings Inc,A,,,31-1429215,,USA,12,4020,402020,40,40202010,D,DE,USA,522291,614 729 4000,,,01,6141,453,940,B,OH,0,www.breadfinancial.com,,2001-06-08 +WILLIS TOWERS WATSON PLC,144009,51 Lime Street,,,,EC3M 7DQ,"Willis Towers Watson Public Limited Company operates as an advisory, broking, and solutions company worldwide. It operates through two segments: Health, Wealth and Career; and Risk & Broking.",0001140536,London,Willis Towers Watson plc,A,,,98-0352587,,IRL,12,4030,403010,40,40301010,B,,GBR,524210,44 20 3124 6000,,,01,6411,330,800,B+,,0,www.willistowerswatson.com,, +ZIMMER BIOMET HOLDINGS INC,144559,345 East Main Street,,,,46580,"Zimmer Biomet Holdings, Inc., together with its subsidiaries, operates as a medical technology company in the Americas, Europe, the Middle East, Africa, and the Asia Pacific.",0001136869,Warsaw,Zimmer Biomet Holdings Inc,A,,,13-4151777,,USA,12,3510,351010,35,35101010,B,DE,USA,339113,574 373 3121,,,01,3842,300,905,B-,IN,0,www.zimmerbiomet.com,, +CENTENE CORP,145552,"Centene Plaza, 7700 Forsyth Boulevard",,,,63105,"Centene Corporation operates as a healthcare enterprise that provides programs and services to under-insured and uninsured families, commercial organizations, and military families in the United States. It operates in two segments, Managed Care and Specialty Services.",0001071739,Saint Louis,Centene Corp,A,,,42-1406317,,USA,12,3510,351020,35,35102030,D,DE,USA,524114,314 725 4477,,,01,6324,287,905,B+,MO,0,www.centene.com,,2001-12-13 +CME GROUP INC,149070,20 South Wacker Drive,,,,60606,"CME Group Inc., together with its subsidiaries, operates contract markets for the trading of futures and options on futures contracts worldwide.",0001156375,Chicago,CME Group Inc,A,,,36-4459170,,USA,12,4020,402030,40,40203040,B,DE,USA,523210,312 930 1000,,,01,6200,822,800,A-,IL,0,www.cmegroup.com,,2002-12-06 +ASSURANT INC,157057,"55 Broadway, Suite 2901",,,,10006,"Assurant, Inc., together with its subsidiaries, provides lifestyle and housing solutions that support, protect, and connect consumer purchases in North America, Latin America, Europe, and the Asia Pacific. The company operates through two segments: Global Lifestyle and Global Housing.",0001267238,New York,Assurant Inc.,A,,,39-1126612,,USA,12,4030,403010,40,40301030,D,DE,USA,524126,212 859 7000,,,01,6351,,,B+,NY,0,www.assurant.com,,2004-02-05 +MARKETAXESS HOLDINGS INC,158742,"55 Hudson Yards, 15th Floor",,,,10001,"MarketAxess Holdings Inc., together with its subsidiaries, operates an electronic trading platform for institutional investor and broker-dealer companies worldwide. It offers the access to liquidity in the U.S. investment-grade bonds, U.S. high-yield bonds, and U.S.",0001278021,New York,MarketAxess Holdings Inc,A,,,52-2230784,212 813 6390,USA,12,4020,402030,40,40203040,D,DE,USA,523210,212 813 6000,,,01,6200,,,A,NY,0,www.marketaxess.com,,2004-11-05 +DIGITAL REALTY TRUST INC,160991,"5707 Southwest Parkway, Building 1, Suite 275",,,,78735,"Digital Realty supports the world's leading enterprises and service providers by delivering the full spectrum of data center, colocation and interconnection solutions.",0001297996,Austin,Digital Realty Trust Inc,A,,,26-0081711,,USA,12,6010,601080,60,60108050,D,MD,USA,531120,737-281-0101,,,01,6798,,,B+,TX,0,www.digitalrealty.com,,2004-10-29 +MOSAIC CO,162129,"101 East Kennedy Boulevard, Suite 2500",,,,33602,"The Mosaic Company, through its subsidiaries, produces and markets concentrated phosphate and potash crop nutrients in North America and internationally. The company operates through three segments: Phosphates, Potash, and Mosaic Fertilizantes.",0001285785,Tampa,Mosaic Company (The),A,,,20-1026454,,USA,12,1510,151010,15,15101030,B,DE,USA,3253,800 918 8270,,,01,2870,,,B,FL,0,www.mosaicco.com,,2004-10-25 +INTERCONTINENTAL EXCHANGE,163610,"5660 New Northside Drive, 3rd Floor",,,,30328,"Intercontinental Exchange, Inc., together with its subsidiaries, operates regulated exchanges, clearing houses, and listings venues for commodity, financial, fixed income, and equity markets in the United States, the United Kingdom, the European Union, Singapore, Israel, and Canada.",0001571949,Atlanta,Intercontinental Exchange Inc,A,,,46-2286804,,USA,12,4020,402030,40,40203040,D,DE,USA,523999,770 857 4700,,,01,6200,,,A-,GA,0,www.ice.com,,2005-11-16 +AMERIPRISE FINANCIAL INC,164708,55 Ameriprise Financial Center,,,,55474,"Ameriprise Financial, Inc., through its subsidiaries, provides various financial products and services to individual and institutional clients in the United States and internationally.",0000820027,Minneapolis,Ameriprise Financial Inc,A,,,13-3180631,,USA,12,4020,402030,40,40203010,D,DE,USA,523150,,,,01,6211,,,A,MN,0,www.ameriprise.com,,2005-10-03 +IPG PHOTONICS CORP,175955,50 Old Webster Road,,,,01540,"IPG Photonics Corporation develops, manufactures, and sells various high-performance fiber lasers, fiber amplifiers, and diode lasers used in various applications primarily in materials processing worldwide.",0001111928,Oxford,IPG Photonics Corp,A,,,04-3444218,508 373 1424,USA,12,4520,452030,45,45203020,D,DE,USA,334413,508 373 1100,,,01,3674,,,B,MA,0,www.ipgphotonics.com,,2006-12-13 +FLEETCOR TECHNOLOGIES INC,184700,"3280 Peachtree Road, Suite 2400",,,,30305,"FLEETCOR Technologies, Inc., a business payments company that helps businesses spend less by enabling them to manage their expense-related purchasing and vendor payments processes.",0001175454,Atlanta,FleetCor Technologies Inc,A,,,72-1074903,,USA,12,4020,402010,40,40201060,D,DE,USA,522320,770 449 0479,,,01,7389,,,B+,GA,0,www.fleetcor.com,,2010-12-15 diff --git a/test/data/ibes_links.csv b/test/data/ibes_links.csv new file mode 100644 index 0000000..ec14048 --- /dev/null +++ b/test/data/ibes_links.csv @@ -0,0 +1,159 @@ +ticker,permno,ncusip,sdate,edate,score +032M,19807,92888110,2020-10-15,2022-03-31,1 +ABBV,13721,00287Y10,2013-01-02,2022-03-31,1 +AFL,57904,02587010,1976-04-15,1992-01-01,1 +AFL,57904,00105510,1992-01-16,2022-03-31,1 +AHC,28484,02355110,1976-01-15,2006-05-08,1 +AHC,28484,42809H10,2006-05-18,2022-03-31,1 +AIG,66800,02687410,1976-01-15,2009-06-30,1 +AIG,66800,02687478,2009-07-16,2022-03-31,1 +AIZI,90038,04621X10,2004-02-19,2022-03-31,1 +AMPW,90880,03076C10,2005-10-03,2022-03-31,1 +AMZN,84788,02313510,1997-06-19,2022-03-31,1 +ASD1,89002,01858110,2001-08-16,2022-03-31,1 +AVN,80381,05337310,1998-06-18,1998-10-04,1 +AVN,80381,05348410,1998-10-15,2022-03-31,1 +AZO,76605,05333210,1991-05-16,2022-03-31,1 +BHI1,75034,05722410,1987-04-24,2017-07-04,1 +BHI1,75034,05722G10,2017-07-20,2022-03-31,1 +BIO,61516,09057220,1980-03-20,2022-03-31,1 +BMY,19393,11009710,1976-01-15,1989-10-03,1 +BMY,19393,11012210,1989-10-19,2022-03-31,1 +BYA,80381,07201210,1994-05-19,1998-06-04,1 +CCL,75154,14365810,1987-07-24,2003-04-20,1 +CCL,75154,14365830,2003-05-15,2022-03-31,1 +CHL,47896,16379810,1976-01-15,1988-04-25,1 +CHL,47896,16372210,1988-05-19,1996-03-31,1 +CHL,47896,16161A10,1996-04-18,2001-01-01,1 +CHL,47896,46625H10,2001-01-18,2022-03-31,1 +CHV,14541,16675110,1984-04-02,2001-10-09,1 +CHV,14541,16676410,2001-10-18,2022-03-31,1 +CMCA,25081,20034010,1982-07-01,2022-03-31,1 +CME,89626,16776010,2003-01-16,2007-07-12,1 +CME,89626,12572Q10,2007-07-19,2022-03-31,1 +CNTE,89269,15135B10,2002-02-14,2022-03-31,1 +CRCH,23393,17134010,1978-06-15,2022-03-31,1 +CTAS,23660,17290810,1983-12-15,2022-03-31,1 +CTLT,14763,14880610,2014-09-18,2022-03-31,1 +DD,16851,26614N10,2019-06-03,2019-06-19,4 +DGX,84373,74834L10,1997-01-16,2022-03-31,1 +DLRN,90373,25386810,2004-11-18,2022-03-31,1 +DOWWI,18428,26055710,2019-04-18,2022-03-31,1 +DWDP,16851,26078J10,2017-09-14,2019-06-02,1 +DWDP,16851,26614N10,2019-06-20,2022-03-31,1 +EOG,75825,29356210,1989-11-16,1999-09-14,1 +EOG,75825,26875P10,1999-09-16,2022-03-31,1 +ERTS,75828,28551210,1989-12-14,2022-03-31,1 +ETN,11762,27805810,1976-01-15,2012-12-02,1 +ETN,11762,G2918310,2012-12-20,2022-03-31,1 +ETSY,15291,29786A10,2015-04-16,2022-03-31,1 +EW,87657,28176E10,2000-05-18,2022-03-31,1 +F,25785,34537010,1976-01-15,2000-08-02,1 +F,25785,34537086,2000-08-17,2022-03-31,1 +FFIV,86964,31561610,1999-07-15,2022-03-31,1 +FLTT,12449,33904110,2011-01-20,2022-03-31,1 +FRCA,12448,33616C10,2010-12-16,2022-03-31,1 +FRRI,37584,35461310,1986-03-20,2022-03-31,1 +FTI,16538,G8711010,2017-02-16,2022-03-31,1 +GD,12052,36955010,1976-01-15,2022-03-31,1 +GIS,17144,37033410,1976-01-15,2022-03-31,1 +GNM,12369,37045V10,2010-11-18,2022-03-31,1 +HAL,23819,40621610,1976-01-15,2022-03-31,1 +HAS,52978,41805610,1980-01-17,2022-03-31,1 +HLTT,14338,43300A10,2013-12-19,2017-01-03,1 +HLTT,14338,43300A20,2017-01-19,2022-03-31,1 +HMT1,46703,44107810,1994-03-17,1998-12-29,1 +HMT1,46703,44107P10,1999-01-14,2022-03-31,1 +HRB,49373,09367110,1976-01-15,2022-03-31,1 +HSY,16600,42786610,1977-07-14,2022-03-31,1 +ICEI,90993,45865V10,2005-11-17,2013-11-12,1 +ICEI,90993,45866F10,2013-11-14,2022-03-31,1 +IMTN,83143,46284P10,1996-03-14,2000-02-01,1 +IMTN,83143,46284610,2000-02-17,2015-01-20,1 +IMTN,83143,46284V10,2015-02-19,2022-03-31,1 +INTC,59328,45814010,1976-01-15,2022-03-31,1 +IPGP,91668,44980X10,2006-12-14,2022-03-31,1 +JNJ,22111,47816010,1976-01-15,2022-03-31,1 +KIM,77129,49446R10,1992-12-17,2022-03-31,1 +LEN,52708,52605710,1978-07-20,2022-03-31,1 +LOW,61399,54866110,1976-01-15,2022-03-31,1 +MCK,81061,58155710,1994-12-15,1999-01-12,1 +MCK,81061,58155Q10,1999-01-14,2022-03-31,1 +MES,17005,58574510,1976-04-14,1996-11-20,1 +MES,17005,12665010,1996-12-19,2022-03-31,1 +MHS,46703,57163010,1976-01-15,1993-10-11,1 +MKTX,90454,57060D10,2004-11-18,2022-03-31,1 +MMM,22592,60405910,1976-01-15,2002-04-07,1 +MMM,22592,88579Y10,2002-04-18,2022-03-31,1 +MOSC,90386,61945A10,2004-11-18,2011-05-24,1 +MOSC,90386,61945C10,2011-06-16,2022-03-31,1 +MOT,22779,62007610,1976-01-15,2011-01-03,1 +MOT,22779,62007630,2011-01-20,2022-03-31,1 +MRK,22752,58933110,1976-01-15,2009-11-03,1 +MRK,22752,58933Y10,2009-11-19,2022-03-31,1 +MXIM,11896,57772K10,1988-09-15,2021-08-25,1 +MYLN,20057,92556V10,2020-11-19,2022-03-31,1 +NI,38762,66526210,1976-01-15,1988-03-03,1 +NI,38762,62914010,1988-03-17,1999-04-14,1 +NI,38762,65473P10,1999-04-15,2022-03-31,1 +NIKE,57665,65410610,1982-05-20,2022-03-31,1 +NOI,84032,63707110,1996-12-19,2021-01-03,1 +NOI,84032,62955J10,2021-01-14,2022-03-31,1 +NU,44206,66439710,1976-01-15,2015-02-18,1 +NU,44206,30040W10,2015-02-19,2022-03-31,1 +NWL,60986,65119210,1978-09-14,1999-03-23,1 +NWL,60986,65122910,1999-04-15,2022-03-31,1 +NWSV,13963,65249B10,2013-07-18,2022-03-31,1 +ORCL,10104,68389X10,1986-06-19,2022-03-31,1 +P,13928,71850710,1976-01-15,2002-09-02,1 +P,13928,20825C10,2002-09-19,2022-03-31,1 +PAYX,61621,70432610,1983-08-26,2022-03-31,1 +PMA,61735,20016610,1981-03-19,1987-04-23,1 +PMA,61735,03738910,1987-05-14,2012-04-01,1 +PMA,61735,G0408V10,2012-04-19,2020-03-31,1 +PMA,61735,G0403H10,2020-04-16,2022-03-31,1 +PNTA,13586,H6169Q10,2012-10-18,2014-06-02,1 +PNTA,13586,G7S00T10,2014-06-19,2022-03-31,1 +POOL,82515,78402810,1995-11-16,2006-05-16,1 +POOL,82515,73278L10,2006-05-18,2022-03-31,1 +PRUD,82303,74435W10,1995-11-16,1996-05-27,1 +PRUD,82303,29980810,1996-06-20,2000-02-23,1 +PRUD,82303,G3223R10,2000-03-16,2022-03-31,1 +RCL,79145,V7780T10,1993-07-15,2022-03-31,1 +REG,79782,75893910,1994-08-18,2001-02-11,1 +REG,79782,75884910,2001-02-15,2022-03-31,1 +ROPR,77338,77669610,1992-05-14,2022-03-31,1 +RTN,24942,75511110,1976-01-15,1997-12-17,1 +RTN,24942,75511140,1998-01-15,2001-05-13,1 +RTN,24942,75511150,2001-06-14,2020-04-02,1 +SBAC,86996,78388J10,1999-07-15,2017-01-16,1 +SBAC,86996,78410G10,2017-01-19,2022-03-31,1 +SBUX,77702,85524410,1992-08-20,2022-03-31,1 +SCE,15720,84240010,1976-01-15,1988-06-30,1 +SCE,15720,78388210,1988-07-14,1996-02-04,1 +SCE,15720,28102010,1996-02-15,2022-03-31,1 +SHW,36468,82434810,1976-01-15,2022-03-31,1 +SNAT,71563,84344410,1984-01-19,1997-05-18,1 +SNAT,71563,05493710,1997-06-19,2019-12-08,1 +SNAT,71563,89832Q10,2019-12-19,2022-03-31,1 +SNPS,77357,87160710,1992-03-19,2022-03-31,1 +TDYT,87445,87936010,1999-12-16,2022-03-31,1 +TER,51369,88077010,1976-01-15,2022-03-31,1 +TYL,76185,90218410,1990-05-22,1999-05-19,1 +TYL,76185,90225210,1999-05-20,2022-03-31,1 +UDRT,59300,91019710,1984-12-31,2007-03-14,1 +UDRT,59300,90265310,2007-03-15,2022-03-31,1 +UHSI,79637,91390310,1982-05-20,2022-03-31,1 +UTX,17830,91301710,1976-01-15,2020-04-02,1 +UTX,17830,75513E10,2020-04-16,2022-03-31,1 +VMC,15202,92916010,1977-04-14,2022-03-31,1 +WATS,78916,94268310,1993-05-20,2013-01-23,1 +WATS,78916,00507K10,2013-02-14,2013-09-30,1 +WATS,78916,G0083B10,2013-10-17,2015-06-14,1 +WATS,78916,G0177J10,2015-06-18,2020-05-08,1 +WSH,89017,G9665510,2001-07-19,2010-01-03,1 +WSH,89017,G9666610,2010-01-14,2016-01-04,1 +WSH,89017,G9662910,2016-01-14,2022-03-31,1 +WY,39917,96216610,1976-01-15,2022-03-31,1 +ZMH,89070,98956P10,2001-08-16,2022-03-31,1 +ZOTS,13788,98978V10,2013-03-14,2022-03-31,1 diff --git a/test/data/option_links.csv b/test/data/option_links.csv new file mode 100644 index 0000000..32b9f8e --- /dev/null +++ b/test/data/option_links.csv @@ -0,0 +1,555 @@ +secid,effect_date,cusip,ticker,class,issuer,issue,sic +100892,1996-01-02,00105510,AFL,,AFLAC INC,COM, +100892,2000-11-28,00105510,AFL,,AFLAC INC,COM,6321 +100892,2020-07-31,00105510,AFL,,AFLAC INC.,ORDINARY SHARES,6321 +101310,1997-05-14,02313510,AMZN,,AMAZON COM INC,, +101310,1998-05-08,02313510,AMZN,,AMAZON.COM INC,, +101310,2000-11-28,02313510,AMZN,,AMAZON COM INC,COM,5942 +101310,2001-07-23,02313510,AMZN,,AMAZON COM INC,COM,5961 +101310,2016-12-22,02313510,AMZN,,AMAZON COM INC,COM,5331 +101310,2020-08-03,02313510,AMZN,,AMAZON.COM INC.,ORDINARY SHARES,5961 +101322,1996-01-02,02355110,AHC,,AMERADA HESS CORP,COM, +101322,2000-11-28,02355110,AHC,,AMERADA HESS CORP,COM,2911 +101322,2006-05-09,42809H10,HES,,HESS CORP,COM,9999 +101322,2006-05-26,42809H10,HES,,HESS CORP,COM,2911 +101322,2016-12-19,42809H10,HES,,HESS CORP,COM,1311 +101322,2017-01-25,42809H10,HES,,HESS CORP,COM,1321 +101322,2017-03-03,42809H10,HES,,HESS CORP,COM,1311 +101322,2017-03-06,42809H10,HES,,HESS CORP,COM,4931 +101322,2017-03-10,42809H10,HES,,HESS CORP,COM,1311 +101322,2017-05-11,42809H10,HES,,HESS CORP,COM,1382 +101322,2017-05-17,42809H10,HES,,HESS CORP,COM,1311 +101322,2020-08-07,42809H10,HES,,HESS CORPORATION,ORDINARY SHARES,2911 +101397,1996-01-01,02687410,AIG,,AMERICAN INTL GROUP INC,COM,6311 +101397,2001-01-29,02687410,AIG,,AMERICAN INTL GROUP INC,COM,6331 +101397,2009-07-01,02687478,AIG,,AMERICAN INTL GROUP INC,COM NEW,6331 +101397,2016-12-19,02687478,AIG,,AMERICAN INTL GROUP INC,COM NEW,6399 +101397,2020-08-05,02687478,AIG,,AMERICAN INTERNATIONAL GROUP,ORDINARY SHARES,6331 +101578,1996-01-02,03738910,AOC,,AON CORP,COM, +101578,2000-11-28,03738910,AOC,,AON CORP,COM,6321 +101578,2001-01-30,03738910,AOC,,AON CORP,COM,6311 +101578,2004-02-17,03738910,AOC,,AON CORP,COM,6321 +101578,2009-12-01,03738910,AON,,AON CORP,COM,6321 +101578,2011-06-10,03738910,AON,,AON CORP,COM,6411 +101578,2012-04-02,G0408V10,AON,,AON PLC,SHS CL A,6411 +101578,2014-01-08,G0408V10,AON,,AON PLC,SHS CL A,6722 +101578,2014-11-24,G0408V10,AON,,AON PLC,SHS CL A,6411 +101578,2020-04-01,G0403H10,AON,,AON PLC.,ORDINARY SHARES - CL, +101806,1996-01-02,05333210,AZO,,AUTOZONE INC,COM, +101806,2000-11-28,05333210,AZO,,AUTOZONE INC,COM,5531 +101806,2020-10-27,05333210,AZO,,AUTOZONE INC.,ORDINARY SHARES,5531 +101812,1996-01-01,07201210,BYA,,BAY APARTMENT CMNTYS INC,, +101812,1998-06-05,05337310,AVB,,AVALON BAY COMMUNITIES INC,, +101812,1998-10-05,05348410,AVB,,AVALONBAY COMMUNITIES INC,, +101812,2000-11-28,05348410,AVB,,AVALONBAY CMNTYS INC,COM,6798 +101812,2020-08-06,05348410,AVB,,AVALONBAY COMMUNITIES INC.,ORDINARY SHARES,6798 +101863,1996-01-01,84344410,SNB,,SOUTHERN NATIONAL CORP,, +101863,1997-05-19,05493710,BBK,,BB&T CORP,, +101863,1999-01-04,05493710,BBT,,BB&T CORP,, +101863,2000-11-28,05493710,BBT,,BB&T CORP,COM,6021 +101863,2001-01-31,05493710,BBT,,BB&T CORP,COM,6712 +101863,2002-01-15,05493710,BBT,,BB&T CORP,COM,6035 +101863,2011-06-10,05493710,BBT,,BB&T CORP,COM,6021 +101863,2016-10-11,05493710,BBT,,BB&T CORP,COM,6712 +101863,2019-12-09,89832Q10,TFC,,TRUIST FINANCIAL CORP,ORDINARY SHARES,6021 +101863,2019-12-12,89832Q10,TFC,,TRUIST FINANCIAL CORPORATION,ORDINARY SHARES,6021 +101920,1996-01-02,05722410,BHI,,BAKER HUGHES INC,COM, +101920,2000-11-28,05722410,BHI,,BAKER HUGHES INC,COM,3533 +101920,2005-03-02,05722410,BHI,,BAKER HUGHES INC,COM,1000 +101920,2005-06-16,05722410,BHI,,BAKER HUGHES INC,COM,3533 +101920,2014-01-07,05722410,BHI,,BAKER HUGHES INC,COM,8741 +101920,2014-03-24,05722410,BHI,,BAKER HUGHES INC,COM,3533 +101920,2017-07-05,05722G10,BHGE,,BAKER HUGHES A GE CO,CL A,3533 +101920,2019-10-18,05722G10,BKR,,BAKER HUGHES CO,ORDINARY SHARES - CL,3533 +102148,1996-01-02,09057220,BIO,A,BIO RAD LABS INC,CL A, +102148,2000-11-28,09057220,BIO,A,BIO RAD LABS INC,CL A,3826 +102148,2002-03-08,09057220,BIO,,BIO RAD LABS INC,CL A,8731 +102148,2008-10-24,09057220,BIO,,BIO RAD LABS INC,CL A,8731 +102148,2010-12-29,09057220,BIO,,BIO RAD LABS INC,CL A,3826 +102148,2020-08-03,09057220,BIO,,BIO-RAD LABORATORIES INC.,ORDINARY SHARES - CL,3826 +102244,1996-01-02,09367110,HRB,,BLOCK H & R INC,COM, +102244,2000-11-28,09367110,HRB,,BLOCK H & R INC,COM,7291 +102244,2006-06-30,09367110,HRB,,BLOCK H & R INC,COM,6159 +102244,2018-07-02,09367110,HRB,,H&R BLOCK INC.,ORDINARY SHARES,7200 +102244,2020-08-03,09367110,HRB,,H&R BLOCK INC.,ORDINARY SHARES,7291 +102349,1996-01-01,11012210,BMY,,BRISTOL MYERS SQUIBB CO,COM,2834 +102349,2020-08-17,11012210,BMY,,BRISTOL-MYERS SQUIBB CO.,ORDINARY SHARES,2834 +102583,1996-01-01,58574510,MES,,MELVILLE CORP,, +102583,1996-10-16,58574510,CVS,,MELVILLE CORP,, +102583,1996-11-22,12665010,CVS,,CVS CORP,, +102583,2000-11-28,12665010,CVS,,CVS CORP,COM,5912 +102583,2007-03-22,12665010,CVS,,CVS CAREMARK CORPORATION,COM,5912 +102583,2014-01-13,12665010,CVS,,CVS CAREMARK CORPORATION,COM,7261 +102583,2014-01-16,12665010,CVS,,CVS CAREMARK CORPORATION,COM,5912 +102583,2014-09-04,12665010,CVS,,CVS HEALTH CORP,COM,5912 +102583,2020-08-06,12665010,CVS,,CVS HEALTH CORP,ORDINARY SHARES,5912 +102752,1996-01-02,14365810,CCL,,CARNIVAL CORP,COM, +102752,2000-11-28,14365810,CCL,,CARNIVAL CORP,COM,4481 +102752,2003-04-21,14365830,CCL,,CARNIVAL CORP,PAIRED CTF,4481 +102752,2018-07-02,14365830,CCL,,CARNIVAL CORP.,ORDINARY SHARES (PAI,4400 +102752,2020-09-16,14365830,CCL,,CARNIVAL CORP.,ORDINARY SHARES (PAI,4725 +102752,2020-11-27,14365830,CCL,,CARNIVAL CORP.,ORDINARY SHARES (PAI,4400 +102936,1996-01-01,16372210,CHL,,CHEMICAL BANKING CORP,, +102936,1996-04-03,16161A10,CMB,,CHASE MANHATTAN CORP,, +102936,2000-11-28,16161A10,CMB,,CHASE MANHATTAN CORP NEW,COM,6021 +102936,2001-01-02,46625H10,JPM,,J P MORGAN CHASE & CO,COM,6021 +102936,2001-03-14,46625H10,JPM,,J P MORGAN CHASE & CO,COM,6712 +102936,2002-02-22,46625H10,JPM,,J P MORGAN CHASE & CO,COM,6021 +102936,2009-01-28,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6021 +102936,2012-08-09,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6282 +102936,2012-08-10,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6211 +102936,2013-11-05,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6021 +102936,2016-06-23,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6099 +102936,2016-08-04,46625H10,JPM,,JPMORGAN CHASE & CO,COM,6021 +102936,2020-08-04,46625H10,JPM,,JPMORGAN CHASE & CO.,ORDINARY SHARES,6021 +102968,1996-01-02,16675110,CHV,,CHEVRON CORPORATION,COM, +102968,2000-11-28,16675110,CHV,,CHEVRON CORPORATION,COM,2911 +102968,2001-10-10,16676410,CVX,,CHEVRONTEXACO CORP,COM,2911 +102968,2005-05-10,16676410,CVX,,CHEVRON CORP NEW,COM,2911 +102968,2014-01-10,16676410,CVX,,CHEVRON CORP NEW,COM,2531 +102968,2014-01-15,16676410,CVX,,CHEVRON CORP NEW,COM,2911 +102968,2016-04-01,16676410,CVX,,CHEVRON CORP,COM,2911 +102968,2016-04-04,16676410,CVX,,CHEVRON CORP NEW,COM,2911 +102968,2016-12-19,16676410,CVX,,CHEVRON CORP NEW,COM,1311 +102968,2020-08-06,16676410,CVX,,CHEVRON CORP.,ORDINARY SHARES,2911 +103016,1996-01-02,17134010,CHD,,CHURCH & DWIGHT INC,COM, +103016,2000-11-28,17134010,CHD,,CHURCH & DWIGHT INC,COM,2841 +103016,2018-07-02,17134010,CHD,,"CHURCH & DWIGHT CO., INC.",ORDINARY SHARES,2840 +103016,2020-08-03,17134010,CHD,,"CHURCH & DWIGHT CO., INC.",ORDINARY SHARES,2841 +103046,1996-01-02,17290810,CTAS,,CINTAS CORP,COM, +103046,2000-11-28,17290810,CTAS,,CINTAS CORP,COM,7213 +103046,2004-02-18,17290810,CTAS,,CINTAS CORP,COM,2326 +103046,2018-07-02,17290810,CTAS,,CINTAS CORPORATION,ORDINARY SHARES,2320 +103046,2020-07-30,17290810,CTAS,,CINTAS CORPORATION,ORDINARY SHARES,9224 +103202,1996-01-02,20034010,CMA,,COMERICA INC,COM, +103202,2000-11-28,20034010,CMA,,COMERICA INC,COM,6021 +103202,2020-08-03,20034010,CMA,,"COMERICA, INC.",ORDINARY SHARES,6021 +104059,1996-01-01,29356210,,,ENRON OIL & GAS,, +104059,1999-09-15,26875P10,EOG,,EOG RESOURCES INC,, +104059,2000-11-28,26875P10,EOG,,EOG RES INC,COM,1311 +104059,2016-12-19,26875P10,EOG,,EOG RES INC,COM,1382 +104059,2020-08-07,26875P10,EOG,,"EOG RESOURCES, INC.",ORDINARY SHARES,1311 +104124,1996-01-02,27805810,ETN,,EATON CORP,COM, +104124,2000-11-28,27805810,ETN,,EATON CORP,COM,3714 +104124,2001-02-13,27805810,ETN,,EATON CORP,COM,3625 +104124,2004-02-18,27805810,ETN,,EATON CORP,COM,3714 +104124,2012-12-03,G2918310,ETN,,EATON CORP PLC,SHS,3714 +104124,2012-12-24,G2918310,ETN,,EATON CORP PLC,SHS,3569 +104124,2016-06-23,G2918310,ETN,,EATON CORP PLC,SHS,3629 +104124,2018-07-02,G2918310,ETN,,EATON CORPORATION PLC,ORDINARY SHARES,3590 +104124,2020-07-30,G2918310,ETN,,EATON CORPORATION PLC,ORDINARY SHARES,3699 +104172,1996-01-01,78388210,SCE,,SCECORP,, +104172,1996-02-07,28102010,EIX,,EDISON INTERNATIONAL,, +104172,2000-11-28,28102010,EIX,,EDISON INTL,COM,4931 +104172,2001-02-13,28102010,EIX,,EDISON INTL,COM,4911 +104172,2020-07-29,28102010,EIX,,EDISON INTERNATIONAL,ORDINARY SHARES,4911 +104185,1996-01-01,28176E10,ZZZZ,,EDWARDS LIFESCIENCES CORP,, +104185,2000-04-03,28176E10,EW,,EDWARDS LIFESCIENCES CORP,, +104185,2000-11-28,28176E10,EW,,EDWARDS LIFESCIENCES CORP,COM,3841 +104185,2020-07-28,28176E10,EW,,EDWARDS LIFESCIENCES CORP,ORDINARY SHARES,3842 +104229,1996-01-02,28551210,ERTS,,ELECTRONIC ARTS INC,COM, +104229,2000-11-28,28551210,ERTS,,ELECTRONIC ARTS INC,COM,7372 +104229,2011-12-20,28551210,EA,,ELECTRONIC ARTS INC,COM,7372 +104229,2017-03-20,28551210,EA,,ELECTRONIC ARTS INC,COM,7929 +104229,2020-08-10,28551210,EA,,"ELECTRONIC ARTS, INC.",ORDINARY SHARES,7372 +104644,1999-06-04,31561610,FFIV,,F5 NETWORKS INC,COM, +104644,2000-11-28,31561610,FFIV,,F5 NETWORKS INC,COM,7373 +104644,2006-06-30,31561610,FFIV,,F5 NETWORKS INC,COM,7372 +104644,2011-06-10,31561610,FFIV,,F5 NETWORKS INC,COM,3576 +104644,2011-08-11,31561610,FFIV,,F5 NETWORKS INC,COM,7371 +104644,2017-12-26,31561610,FFIV,,F5 NETWORKS INC,COM,7373 +104644,2018-07-02,31561610,FFIV,,"F5 NETWORKS, INC.",ORDINARY SHARES,3576 +104644,2020-08-06,31561610,FFIV,,"F5 NETWORKS, INC.",ORDINARY SHARES,7371 +104644,2021-11-16,31561610,FFIV,,F5 INC,ORDINARY SHARES,7371 +104939,1996-01-01,34537010,F,,FORD MOTOR CO,, +104939,2000-08-03,34537086,F,,FORD MOTOR CO,, +104939,2000-11-28,34537086,F,,FORD MTR CO DEL,COM PAR $0.01,3711 +104939,2020-08-03,34537086,F,,FORD MOTOR CO.,ORDINARY SHARES,3711 +104992,1996-01-02,35461310,BEN,,FRANKLIN RES INC,COM, +104992,2000-11-28,35461310,BEN,,FRANKLIN RES INC,COM,6211 +104992,2014-01-08,35461310,BEN,,FRANKLIN RES INC,COM,6722 +104992,2015-01-12,35461310,BEN,,FRANKLIN RES INC,COM,6282 +104992,2015-01-23,35461310,BEN,,FRANKLIN RES INC,COM,6722 +104992,2020-07-31,35461310,BEN,,"FRANKLIN RESOURCES, INC.",ORDINARY SHARES,6282 +105168,1996-01-02,36955010,GD,,GENERAL DYNAMICS CORP,COM, +105168,2000-11-28,36955010,GD,,GENERAL DYNAMICS CORP,COM,3731 +105168,2014-01-08,36955010,GD,,GENERAL DYNAMICS CORP,COM,3721 +105168,2018-07-02,36955010,GD,,GENERAL DYNAMICS CORP.,ORDINARY SHARES,3730 +105168,2020-07-31,36955010,GD,,GENERAL DYNAMICS CORP.,ORDINARY SHARES,3812 +105174,1996-01-02,37033410,GIS,,GENERAL MLS INC,COM, +105174,2000-11-28,37033410,GIS,,GENERAL MLS INC,COM,2043 +105174,2014-01-08,37033410,GIS,,GENERAL MLS INC,COM,2041 +105174,2014-01-10,37033410,GIS,,GENERAL MLS INC,COM,5912 +105174,2014-02-04,37033410,GIS,,GENERAL MLS INC,COM,2041 +105174,2018-07-02,37033410,GIS,,"GENERAL MILLS, INC.",ORDINARY SHARES,2040 +105174,2020-08-11,37033410,GIS,,"GENERAL MILLS, INC.",ORDINARY SHARES,2043 +105512,1996-01-02,40621610,HAL,,HALLIBURTON CO,COM, +105512,2000-11-28,40621610,HAL,,HALLIBURTON CO,COM,1389 +105512,2020-07-31,40621610,HAL,,HALLIBURTON CO.,ORDINARY SHARES,1389 +105588,1996-01-02,41805610,HAS,,HASBRO INC,COM, +105588,2000-11-28,41805610,HAS,,HASBRO INC,COM,3944 +105588,2010-12-21,41805610,HAS,,HASBRO INC,COM,3944 +105588,2020-08-03,41805610,HAS,,"HASBRO, INC.",ORDINARY SHARES,3944 +105696,1996-01-02,42786610,HSY,,HERSHEY FOODS CORP,COM, +105696,2000-11-28,42786610,HSY,,HERSHEY FOODS CORP,COM,2066 +105696,2005-04-20,42786610,HSY,,HERSHEY CO,COM,2066 +105696,2014-01-10,42786610,HSY,,HERSHEY CO,COM,5912 +105696,2014-01-30,42786610,HSY,,HERSHEY CO,COM,2066 +105696,2018-07-02,42786610,HSY,,HERSHEY COMPANY,ORDINARY SHARES,2060 +105696,2020-07-27,42786610,HSY,,HERSHEY COMPANY,ORDINARY SHARES,2066 +105805,1996-01-01,44107810,HMT,,HOST MARRIOTT CORP,, +105805,1998-12-30,44107P10,HMT,,HOST MARRIOTT CORP,, +105805,2000-11-28,44107P10,HMT,,HOST MARRIOTT CORP NEW,COM,6798 +105805,2006-04-18,44107P10,HST,,HOST HOTELS & RESORTS INC,COM,6798 +105805,2006-06-30,44107P10,HST,,HOST HOTELS & RESORTS INC,COM,7011 +105805,2011-06-10,44107P10,HST,,HOST HOTELS & RESORTS INC,COM,6798 +105805,2020-08-03,44107P10,HST,,HOST HOTELS & RESORTS INC,ORDINARY SHARES,6798 +105914,1996-01-02,44966910,IGL,,IMC GLOBAL INC,COM, +105914,2000-11-28,44966910,IGL,,IMC GLOBAL INC,COM,2874 +105914,2004-10-25,61945A10,MOS,,MOSAIC CO,COM,2874 +105914,2011-05-20,61945C10,MOS,,MOSAIC CO NEW,COM,9999 +105914,2011-05-26,61945C10,MOS,,MOSAIC CO NEW,COM,2874 +105914,2011-07-19,61945C10,MOS,,MOSAIC CO NEW,COM,2874 +105914,2018-07-02,61945C10,MOS,,MOSAIC COMPANY,ORDINARY SHARES,2870 +105914,2020-08-05,61945C10,MOS,,MOSAIC COMPANY,ORDINARY SHARES,2874 +106203,1996-01-02,45814010,INTC,,INTEL CORP,COM, +106203,2000-11-28,45814010,INTC,,INTEL CORP,COM,3674 +106203,2020-07-31,45814010,INTC,,INTEL CORP.,ORDINARY SHARES,3674 +106407,1996-01-01,46284P10,IMTN,,IRON MOUNTAIN INC,, +106407,1999-04-26,46284P10,IRM,,IRON MOUNTAIN INC,, +106407,2000-02-02,46284610,IRM,,IRON MOUNTAIN INC,, +106407,2000-11-28,46284610,IRM,,IRON MTN INC PA,COM,4225 +106407,2005-05-31,46284610,IRM,,IRON MTN INC,COM,4225 +106407,2011-06-16,46284610,IRM,,IRON MTN INC,COM,8742 +106407,2014-07-11,46284610,IRM,,IRON MTN INC,COM,4226 +106407,2015-01-21,46284V10,IRM,,IRON MTN INC NEW,COM,6798 +106407,2016-09-19,46284V10,IRM,,IRON MTN INC NEW,COM,4226 +106407,2017-06-08,46284V10,IRM,,IRON MTN INC NEW,COM,6798 +106407,2017-12-26,46284V10,IRM,,IRON MTN INC NEW,COM,4226 +106407,2020-08-07,46284V10,IRM,,IRON MOUNTAIN INC.,ORDINARY SHARES,6798 +106566,1996-01-02,47816010,JNJ,,JOHNSON & JOHNSON,COM, +106566,2000-11-28,47816010,JNJ,,JOHNSON & JOHNSON,COM,2834 +106566,2006-03-16,47816010,JNJ,,JOHNSON & JOHNSON,COM,5000 +106566,2006-07-11,47816010,JNJ,,JOHNSON & JOHNSON,COM,2834 +106566,2020-07-27,47816010,JNJ,,JOHNSON & JOHNSON,ORDINARY SHARES,2834 +106690,1996-01-02,49446R10,KIM,,KIMCO REALTY CORP,COM, +106690,2000-11-28,49446R10,KIM,,KIMCO REALTY CORP,COM,6798 +106690,2010-11-04,49446R10,KIM,,KIMCO RLTY CORP,COM,6798 +106690,2020-08-10,49446R10,KIM,,KIMCO REALTY CORP.,ORDINARY SHARES,6798 +106899,1996-01-02,52605710,LEN,,LENNAR CORP,COM, +106899,2000-11-28,52605710,LEN,,LENNAR CORP,COM,6552 +106899,2001-08-27,52605710,LEN,,LENNAR CORP,COM,1531 +106899,2001-11-12,52605710,LEN,,LENNAR CORP,COM,1521 +106899,2003-04-22,52605710,LEN,,LENNAR CORP,CL A,1521 +106899,2018-07-02,52605710,LEN,,LENNAR CORP.,ORDINARY SHARES - CL,1520 +106899,2020-10-02,52605710,LEN,,LENNAR CORP.,ORDINARY SHARES - CL,1531 +107045,1996-01-02,54866110,LOW,,LOWES COS INC,COM, +107045,2000-11-28,54866110,LOW,,LOWES COS INC,COM,5211 +107045,2014-02-26,54866110,LOW,,LOWES COS INC,COM,9999 +107045,2014-03-19,54866110,LOW,,LOWES COS INC,COM,5211 +107045,2020-08-27,54866110,LOW,,"LOWE`S COS., INC.",ORDINARY SHARES,5211 +107289,1996-01-02,57772K10,MXIM,,MAXIM INTEGRATED PRODS INC,COM, +107289,2000-11-28,57772K10,MXIM,,MAXIM INTEGRATED PRODS INC,COM,3674 +107289,2008-10-08,57772K10,MXIM,,MAXIM INTEGRATED PRODS INC,COM,3674 +107289,2020-08-20,57772K10,MXIM,,"MAXIM INTEGRATED PRODUCTS, I",ORDINARY SHARES,3674 +107325,1996-01-01,58155710,MKN,,MCKESSON CORP,, +107325,1999-01-13,58155Q10,MKN,,MCKESSON HBOC INC,, +107325,2000-11-28,58155Q10,MCK,,MCKESSON HBOC INC,COM,5122 +107325,2001-08-21,58155Q10,MCK,,MCKESSON CORP,COM,5122 +107325,2017-01-26,58155Q10,MCK,,MCKESSON CORP,COM,8099 +107325,2020-08-04,58155Q10,MCK,,MCKESSON CORPORATION,ORDINARY SHARES,5122 +107430,1996-01-02,58933110,MRK,,MERCK & CO INC,COM, +107430,2000-11-28,58933110,MRK,,MERCK & CO INC,COM,2834 +107430,2008-05-06,58933110,MRK,,MERCK & CO INC,COM,2836 +107430,2009-11-04,58933Y10,MRK,,MERCK & CO INC NEW,COM,2834 +107430,2009-11-05,58933Y10,MRK,,MERCK & CO INC NEW,COM,2834 +107430,2016-06-08,58933Y10,MRK,,MERCK & CO INC,COM,2834 +107430,2020-08-06,58933Y10,MRK,,MERCK & CO INC,ORDINARY SHARES,2834 +107616,1996-01-02,60405910,MMM,,MINNESOTA MNG & MFG CO,COM, +107616,2000-11-28,60405910,MMM,,MINNESOTA MNG & MFG CO,COM,2672 +107616,2002-04-08,88579Y10,MMM,,3M CO,COM,2672 +107616,2004-03-04,88579Y10,MMM,,3M CO,COM,2834 +107616,2017-01-11,88579Y10,MMM,,3M CO,COM,5099 +107616,2020-07-29,88579Y10,MMM,,3M CO.,ORDINARY SHARES,3841 +107747,1996-01-02,62007610,MOT,,MOTOROLA INC,COM, +107747,2000-11-28,62007610,MOT,,MOTOROLA INC,COM,3663 +107747,2004-12-02,62007610,MOT,,MOTOROLA INC,COM,3663 +107747,2011-01-04,62007630,MSI,,"MOTOROLA SOLUTIONS, INC.",COM NEW,3663 +107747,2017-01-12,62007630,MSI,,MOTOROLA SOLUTIONS INC,COM NEW,3679 +107747,2020-08-10,62007630,MSI,,MOTOROLA SOLUTIONS INC,ORDINARY SHARES,3663 +107939,1996-10-29,63707110,NOI,,NATIONAL-OILWELL INC,COM, +107939,2000-11-28,63707110,NOI,,NATIONAL-OILWELL INC,COM,3533 +107939,2005-03-14,63707110,NOV,,NATIONAL OILWELL VARCO INC,COM,3533 +107939,2020-07-29,63707110,NOV,,NATIONAL OILWELL VARCO INC.,ORDINARY SHARES,3533 +107939,2021-01-04,62955J10,NOV,,NOV INC,ORDINARY SHARES,3533 +108120,1996-01-01,65119210,,,NEWELL COMPANIES,, +108120,1999-03-25,65122910,NWL,,NEWELL RUBBERMAID INC,, +108120,2000-11-28,65122910,NWL,,NEWELL RUBBERMAID INC,COM,3221 +108120,2016-04-18,65122910,NWL,,NEWELL BRANDS INC,COM,3089 +108120,2018-12-11,65122910,NWL,,NEWELL BRANDS INC,ORDINARY SHARES,3089 +108161,1996-01-01,65410610,NKE,,NIKE INC -CL B,, +108161,2000-11-28,65410610,NKE,,NIKE INC,CL B,3021 +108161,2020-07-27,65410610,NKE,,"NIKE, INC.",ORDINARY SHARES - CL,3021 +108166,1996-01-01,62914010,NI,,NIPSCO INDUSTRIES INC,, +108166,1999-04-15,65473P10,NI,,NISOURCE INC,, +108166,2000-11-28,65473P10,NI,,NISOURCE INC,COM,4931 +108166,2017-12-26,65473P10,NI,,NISOURCE INC,COM,4939 +108166,2020-08-06,65473P10,NI,,NISOURCE INC. (HOLDING CO.),ORDINARY SHARES,4931 +108220,1996-01-02,66439710,NU,,NORTHEAST UTILS,COM, +108220,2000-11-28,66439710,NU,,NORTHEAST UTILS,COM,4911 +108220,2015-02-19,30040W10,ES,,EVERSOURCE ENERGY,COM,4911 +108220,2016-12-19,30040W10,ES,,EVERSOURCE ENERGY,COM,4932 +108220,2017-01-25,30040W10,ES,,EVERSOURCE ENERGY,COM,4911 +108220,2017-03-06,30040W10,ES,,EVERSOURCE ENERGY,COM,5153 +108220,2017-03-10,30040W10,ES,,EVERSOURCE ENERGY,COM,4932 +108220,2020-08-11,30040W10,ES,,EVERSOURCE ENERGY,ORDINARY SHARES,4911 +108505,1996-01-01,68389X10,ORCL,,ORACLE CORP,, +108505,1996-01-03,68389X10,ORCL,,ORACLE SYSTEMS CORP,, +108505,1996-02-20,68389X10,ORCL,,ORACLE CORP,, +108505,2000-11-28,68389X10,ORCL,,ORACLE CORP,COM,7372 +108505,2013-07-15,68389X10,ORCL,,ORACLE CORP,COM,7372 +108505,2013-07-16,68389X10,ORCL,,ORACLE CORP,COM,7372 +108505,2020-09-16,68389X10,ORCL,,ORACLE CORP.,ORDINARY SHARES,7372 +108804,1996-01-02,70432610,PAYX,,PAYCHEX INC,COM, +108804,2000-11-28,70432610,PAYX,,PAYCHEX INC,COM,7379 +108804,2001-03-14,70432610,PAYX,,PAYCHEX INC,COM,8721 +108804,2006-06-30,70432610,PAYX,,PAYCHEX INC,COM,8741 +108804,2017-12-26,70432610,PAYX,,PAYCHEX INC,COM,8721 +108804,2018-07-02,70432610,PAYX,,PAYCHEX INC.,ORDINARY SHARES,8700 +108804,2020-10-05,70432610,PAYX,,PAYCHEX INC.,ORDINARY SHARES,8721 +108861,1996-01-01,70963110,PNTA,,PENTAIR INC,, +108861,1996-03-06,70963110,PNR,,PENTAIR INC,, +108861,2000-11-28,70963110,PNR,,PENTAIR INC,COM,2621 +108861,2001-03-19,70963110,PNR,,PENTAIR INC,COM,3469 +108861,2012-10-01,H6169Q10,PNR,,PENTAIR LTD,SHS,4941 +108861,2013-04-16,H6169Q10,PNR,,PENTAIR LTD,SHS,3823 +108861,2014-06-03,G7S00T10,PNR,,PENTAIR PLC,SHS,3823 +108861,2015-02-06,G7S00T10,PNR,,PENTAIR PLC,SHS,3491 +108861,2017-12-26,G7S00T10,PNR,,PENTAIR PLC,SHS,3559 +108861,2018-07-02,G7S00T10,PNR,,PENTAIR PLC,ORDINARY SHARES,3550 +108861,2020-08-03,G7S00T10,PNR,,PENTAIR PLC,ORDINARY SHARES,3492 +108969,1996-01-02,71850710,P,,PHILLIPS PETE CO,COM, +108969,2000-11-28,71850710,P,,PHILLIPS PETE CO,COM,1311 +108969,2002-07-01,71850710,PLP,,PHILLIPS PETE CO,COM,1311 +108969,2002-09-03,20825C10,COP,,CONOCOPHILLIPS,COM,1311 +108969,2005-05-19,20825C10,COP,,CONOCOPHILLIPS,COM,2911 +108969,2014-01-08,20825C10,COP,,CONOCOPHILLIPS,COM,1382 +108969,2018-01-08,20825C10,COP,,CONOCOPHILLIPS,UNIT EX 123124,1382 +108969,2018-01-12,20825C10,COP,,CONOCOPHILLIPS,COM,1382 +108969,2020-11-04,20825C10,COP,,CONOCO PHILLIPS,ORDINARY SHARES,2911 +109371,1996-12-17,74834L10,DGX,,QUEST DIAGNOSTICS INC,COM, +109371,2000-11-28,74834L10,DGX,,QUEST DIAGNOSTICS INC,COM,8071 +109371,2020-07-27,74834L10,DGX,,"QUEST DIAGNOSTICS, INC.",ORDINARY SHARES,8071 +109497,1996-01-01,75511110,RTN,,RAYTHEON CO,, +109497,1997-12-18,75511140,RTN,B,RAYTHEON CO -CL B,, +109497,2000-11-28,75511140,RTN,B,RAYTHEON CO,CL B,3812 +109497,2001-05-15,75511150,RTN,,RAYTHEON CO,COM NEW,3812 +109497,2020-04-03,75511150,,,RAYTHEON CO,COM,3812 +109542,1996-01-01,75893910,REG,,REGENCY REALTY CORP,, +109542,2000-11-28,75893910,REG,,REGENCY RLTY CORP,COM,6798 +109542,2001-02-12,75884910,REG,,REGENCY CTRS CORP,COM,6798 +109542,2018-11-13,75884910,REG,,REGENCY CENTERS CORPORATION,ORDINARY SHARES,6798 +109699,1996-01-01,77669610,ROPR,,ROPER INDUSTRIES INC/DE,, +109699,1996-11-01,77669610,ROP,,ROPER INDUSTRIES INC/DE,, +109699,2000-11-28,77669610,ROP,,ROPER INDS INC NEW,COM,3561 +109699,2011-06-13,77669610,ROP,,ROPER INDS INC NEW,COM,3823 +109699,2015-04-29,77669610,ROP,,ROPER TECHNOLOGIES INC,COM,3823 +109699,2020-08-06,77669610,ROP,,ROPER TECHNOLOGIES INC,ORDINARY SHARES,3823 +109777,1999-06-16,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM, +109777,2000-11-28,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,1752 +109777,2001-12-26,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,3661 +109777,2011-06-13,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,4899 +109777,2012-09-27,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,4812 +109777,2014-01-27,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,4899 +109777,2016-12-20,78388J10,SBAC,,SBA COMMUNICATIONS CORP,COM,4812 +109777,2017-01-17,78410G10,SBAC,,SBA COMMUNICATIONS CORP NEW,CL A,4812 +109777,2020-08-07,78410G10,SBAC,,SBA COMMUNICATIONS CORP,ORDINARY SHARES - CL,6798 +109791,1996-01-02,78402810,POOL,,SCP POOL CORP,COM, +109791,2000-11-28,78402810,POOL,,SCP POOL CORP,COM,5091 +109791,2006-05-17,73278L10,POOL,,POOL CORPORATION,COM,5091 +109791,2006-06-30,73278L10,POOL,,POOL CORPORATION,COM,3949 +109791,2017-12-26,73278L10,POOL,,POOL CORPORATION,COM,5091 +109791,2018-07-02,73278L10,POOL,,POOL CORPORATION,ORDINARY SHARES,5090 +109791,2020-08-03,73278L10,POOL,,POOL CORPORATION,ORDINARY SHARES,5091 +110117,1996-01-02,82434810,SHW,,SHERWIN WILLIAMS CO,COM, +110117,2000-11-28,82434810,SHW,,SHERWIN WILLIAMS CO,COM,2851 +110117,2004-02-20,82434810,SHW,,SHERWIN WILLIAMS CO,COM,5231 +110117,2014-01-08,82434810,SHW,,SHERWIN WILLIAMS CO,COM,3272 +110117,2015-07-01,82434810,SHW,,SHERWIN WILLIAMS CO,COM,5231 +110117,2017-06-01,82434810,SHW,,SHERWIN WILLIAMS CO,COM,5198 +110117,2017-06-09,82434810,SHW,,SHERWIN WILLIAMS CO,COM,5231 +110117,2017-06-12,82434810,SHW,,SHERWIN WILLIAMS CO,COM,5198 +110117,2018-07-02,82434810,SHW,,SHERWIN-WILLIAMS CO.,ORDINARY SHARES,5200 +110117,2020-07-29,82434810,SHW,,SHERWIN-WILLIAMS CO.,ORDINARY SHARES,2851 +110472,1996-01-02,85524410,SBUX,,STARBUCKS CORP,COM, +110472,2000-11-28,85524410,SBUX,,STARBUCKS CORP,COM,5499 +110472,2004-02-20,85524410,SBUX,,STARBUCKS CORP,COM,5812 +110472,2018-07-02,85524410,SBUX,,STARBUCKS CORP.,ORDINARY SHARES,5810 +110472,2020-07-29,85524410,SBUX,,STARBUCKS CORP.,ORDINARY SHARES,2095 +110700,1996-01-02,87160710,SNPS,,SYNOPSYS INC,COM, +110700,2000-11-28,87160710,SNPS,,SYNOPSYS INC,COM,7372 +110700,2020-08-24,87160710,SNPS,,"SYNOPSYS, INC.",ORDINARY SHARES,7372 +110885,1999-11-23,87936010,TDY,,TELEDYNE TECHNOLOGIES INC,COM, +110885,2000-11-28,87936010,TDY,,TELEDYNE TECHNOLOGIES INC,COM,8711 +110885,2020-07-31,87936010,TDY,,TELEDYNE TECHNOLOGIES INC,ORDINARY SHARES,3812 +110952,1996-01-02,88077010,TER,,TERADYNE INC,COM, +110952,2000-11-28,88077010,TER,,TERADYNE INC,COM,3823 +110952,2002-01-08,88077010,TER,,TERADYNE INC,COM,3825 +110952,2018-11-27,88077010,TER,,"TERADYNE, INC.",ORDINARY SHARES,3825 +111284,1996-01-01,90218310,,,TYLER CORP/DE,, +111284,1999-05-20,90225210,TYL,,TYLER TECHNOLOGIES INC,, +111284,2000-11-28,90225210,TYL,,TYLER TECHNOLOGIES INC,COM,2851 +111284,2001-03-30,90225210,TYL,,TYLER TECHNOLOGIES INC,COM,7379 +111284,2002-01-11,90225210,TYL,,TYLER TECHNOLOGIES INC,COM,7373 +111284,2006-06-30,90225210,TYL,,TYLER TECHNOLOGIES INC,COM,7372 +111284,2020-07-30,90225210,TYL,,"TYLER TECHNOLOGIES, INC.",ORDINARY SHARES,7372 +111416,1998-06-08,91019710,UDR,,UNITED DOMINION REALTY TR IN,COM,6798 +111416,2007-03-15,90265310,UDR,,UDR INC,COM,9999 +111416,2008-04-25,90265310,UDR,,UDR INC,COM,6798 +111416,2020-07-30,90265310,UDR,,UDR INC,ORDINARY SHARES,6798 +111459,1996-01-02,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM, +111459,2000-11-28,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM,3721 +111459,2001-03-14,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM,3724 +111459,2014-01-08,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM,3585 +111459,2015-05-21,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM,3324 +111459,2016-12-08,91301710,UTX,,UNITED TECHNOLOGIES CORP,COM,3724 +111459,2020-04-03,75513E10,RTX,,RAYTHEON TECHNOLOGIES CORPOR,ORDINARY SHARES,3724 +111493,1996-01-02,91390310,UHS,,UNIVERSAL HLTH SVCS INC,CL B, +111493,2000-11-28,91390310,UHS,,UNIVERSAL HLTH SVCS INC,CL B,8062 +111493,2020-08-11,91390310,UHS,,"UNIVERSAL HEALTH SERVICES, I",ORDINARY SHARES - CL,8062 +111822,1996-01-02,92916010,VMC,,VULCAN MATLS CO,COM, +111822,2000-11-28,92916010,VMC,,VULCAN MATLS CO,COM,1422 +111822,2011-06-16,92916010,VMC,,VULCAN MATLS CO,COM,1442 +111822,2017-12-26,92916010,VMC,,VULCAN MATLS CO,COM,1422 +111822,2018-07-02,92916010,VMC,,VULCAN MATERIALS CO,ORDINARY SHARES,1400 +111822,2020-08-06,92916010,VMC,,VULCAN MATERIALS CO,ORDINARY SHARES,1429 +111907,1996-01-01,94268310,WATS,,WATSON PHARMACEUTICALS INC,, +111907,1997-09-17,94268310,WPI,,WATSON PHARMACEUTICALS INC,, +111907,2000-11-28,94268310,WPI,,WATSON PHARMACEUTICALS INC,COM,2834 +111907,2013-01-24,00507K10,ACT,,ACTAVIS INC,COM,2834 +111907,2013-10-01,G0083B10,ACT,,ACTAVIS PLC,SHS,2834 +111907,2015-06-15,G0177J10,AGN,,ALLERGAN PLC,SHS,2834 +111907,2020-05-11,G0177J10,,,ALLERGAN PLC,ORDINARY SHARES,2834 +112011,1996-01-02,96216610,WY,,WEYERHAEUSER CO,COM, +112011,2000-11-28,96216610,WY,,WEYERHAEUSER CO,COM,2421 +112011,2001-03-14,96216610,WY,,WEYERHAEUSER CO,COM,2621 +112011,2004-02-09,96216610,WY,,WEYERHAEUSER CO,COM,2421 +112011,2005-08-09,96216610,WY,,WEYERHAEUSER CO,COM,2411 +112011,2011-06-13,96216610,WY,,WEYERHAEUSER CO,COM,6798 +112011,2014-01-09,96216610,WY,,WEYERHAEUSER CO,COM,2499 +112011,2016-09-15,96216610,WY,,WEYERHAEUSER CO,COM,6798 +112011,2017-01-11,96216610,WY,,WEYERHAEUSER CO,COM,0831 +112011,2020-08-03,96216610,WY,,WEYERHAEUSER CO.,ORDINARY SHARES,6798 +112282,1996-01-01,74435W10,,,PRUDENTIAL REINS HLDGS INC,, +112282,1996-05-28,29980810,RE,,EVEREST REINSURANCE HLDGS,, +112282,2000-02-24,G3223R10,,,EVEREST RE GROUP LTD,, +112282,2000-11-28,G3223R10,RE,,EVEREST RE GROUP LTD,COM,6719 +112282,2001-06-01,G3223R10,RE,,EVEREST RE GROUP LTD,COM,6321 +112282,2006-06-30,G3223R10,RE,,EVEREST RE GROUP LTD,COM,6331 +112282,2020-08-11,G3223R10,RE,,EVEREST RE GROUP LTD,ORDINARY SHARES,6331 +112463,1996-01-02,V7780T10,RCL,,ROYAL CARIBBEAN CRUISES LTD,COM, +112463,2000-11-28,V7780T10,RCL,,ROYAL CARIBBEAN CRUISES LTD,COM,4481 +112463,2011-06-16,V7780T10,RCL,,ROYAL CARIBBEAN CRUISES LTD,COM,7011 +112463,2017-12-26,V7780T10,RCL,,ROYAL CARIBBEAN CRUISES LTD,COM,4481 +112463,2018-07-02,V7780T10,RCL,,ROYAL CARIBBEAN CRUISES LTD.,ORDINARY SHARES,4400 +112463,2020-08-11,V7780T10,RCL,,ROYAL CARIBBEAN GROUP,ORDINARY SHARES,4481 +112888,2001-07-24,98956P10,ZMRHV,,ZIMMER HLDGS INC,COM,9999 +112888,2001-08-06,98956P10,ZMH,,ZIMMER HLDGS INC,COM,3842 +112888,2001-08-07,98956P10,ZMH,,ZIMMER HLDGS INC,COM,3842 +112888,2015-06-29,98956P10,ZBH,,ZIMMER BIOMET HLDGS INC,COM,3842 +112888,2020-08-06,98956P10,ZBH,,ZIMMER BIOMET HOLDINGS INC,ORDINARY SHARES,3842 +113430,2001-12-12,15135B10,CNTE,,CENTENE CORP DEL,COM,9999 +113430,2002-01-29,15135B10,CNTE,,CENTENE CORP DEL,COM,6324 +113430,2003-10-16,15135B10,CNC,,CENTENE CORP DEL,COM,6324 +113430,2020-07-31,15135B10,CNC,,CENTENE CORP.,ORDINARY SHARES,6324 +115211,2001-06-08,01858110,ADS,,ALLIANCE DATA SYSTEMS CORP,COM,9999 +115211,2001-06-11,01858110,ADS,,ALLIANCE DATA SYSTEMS CORP,COM,7374 +115211,2006-06-30,01858110,ADS,,ALLIANCE DATA SYSTEMS CORP,COM,7389 +115211,2014-01-08,01858110,ADS,,ALLIANCE DATA SYSTEMS CORP,COM,7322 +115211,2020-08-05,01858110,ADS,,ALLIANCE DATA SYSTEM,ORDINARY SHARES,7389 +115225,2001-06-12,G9665510,WSH,,WILLIS GROUP HOLDINGS LTD,SHS,9999 +115225,2010-01-04,G9666610,WSH,,WILLIS GROUP HOLDINGS PUBLIC,SHS,6411 +115225,2016-01-05,G9662910,WLTW,,WILLIS TOWERS WATSON PUB LTD,SHS,6411 +115225,2020-07-31,G9662910,WLTW,,WILLIS TOWERS WATSON PUBLIC,ORDINARY SHARES,6411 +115225,2022-01-10,G9662910,WTW,,WILLIS TOWERS WATSON PUBLIC,ORDINARY SHARES,6411 +116532,2002-12-06,16776010,CME,,CHICAGO MERCANTILE HLDGS INC,CL A,9999 +116532,2002-12-20,16776010,CME,,CHICAGO MERCANTILE HLDGS INC,CL A,6211 +116532,2004-03-05,16776010,CME,,CHICAGO MERCANTILE HLDGS INC,CL A,6231 +116532,2007-07-13,12572Q10,CME,,CME GROUP INC,COM,6231 +116532,2008-07-14,12572Q10,CME,,CME GROUP INC,COM,6231 +116532,2017-08-03,12572Q10,CME,,CME GROUP INC,COM CL A,6231 +116532,2018-07-02,12572Q10,CME,,CME GROUP INC,ORDINARY SHARES - CL,6200 +116532,2020-08-06,12572Q10,CME,,CME GROUP INC,ORDINARY SHARES - CL,6231 +120322,2004-02-05,04621X10,AIZ,,ASSURANT INC,COM,6331 +120322,2015-07-01,04621X10,AIZ,,ASSURANT INC,COM,6321 +120322,2016-12-08,04621X10,AIZ,,ASSURANT INC,COM,6331 +120322,2016-12-19,04621X10,AIZ,,ASSURANT INC,COM,6399 +120322,2020-08-10,04621X10,AIZ,,ASSURANT INC,ORDINARY SHARES,6321 +122122,2004-10-29,25386810,DLR,,DIGITAL RLTY TR INC,COM,6798 +122122,2020-08-11,25386810,DLR,,DIGITAL REALTY TRUST INC,ORDINARY SHARES,6798 +122344,2004-11-05,57060D10,MKTX,,MARKETAXESS HLDGS INC,COM,7375 +122344,2006-06-30,57060D10,MKTX,,MARKETAXESS HLDGS INC,COM,6211 +122344,2020-07-27,57060D10,MKTX,,MARKETAXESS HOLDINGS INC.,ORDINARY SHARES,6211 +124943,2005-09-15,03076C10,AMP,,AMERIPRISE FINL INC,COM,9999 +124943,2005-10-03,03076C10,AMP,,AMERIPRISE FINL INC,COM,9999 +124943,2005-10-10,03076C10,AMP,,AMERIPRISE FINL INC,COM,6282 +124943,2011-06-10,03076C10,AMP,,AMERIPRISE FINL INC,COM,6282 +124943,2020-08-11,03076C10,AMP,,AMERIPRISE FINANCIAL INC,ORDINARY SHARES,6282 +125175,2005-11-16,45865V10,ICE,,INTERCONTINENTALEXCHANGE INC,COM,6231 +125175,2006-06-30,45865V10,ICE,,INTERCONTINENTALEXCHANGE INC,COM,6792 +125175,2013-11-01,45865V10,ICE,,INTERCONTINENTALEXCHANGE INC,COM,6231 +125175,2013-11-04,45865V10,ICE,,INTERCONTINENTALEXCHANGE INC,COM,6231 +125175,2013-11-13,45866F10,ICE,,INTERCONTINENTALEXCHANGE GRO,COM,6231 +125175,2014-06-03,45866F10,ICE,,INTERCONTINENTAL EXCHANGE IN,COM,6231 +125175,2018-07-02,45866F10,ICE,,INTERCONTINENTAL EXCHANGE IN,ORDINARY SHARES,6200 +125175,2020-07-31,45866F10,ICE,,INTERCONTINENTAL EXCHANGE IN,ORDINARY SHARES,6231 +128575,2006-12-13,44980X10,IPGP,,IPG PHOTONICS CORP,COM,3674 +128575,2017-12-26,44980X10,IPGP,,IPG PHOTONICS CORP,COM,3699 +128575,2020-08-05,44980X10,IPGP,,IPG PHOTONICS CORP,ORDINARY SHARES,3674 +144671,2010-11-17,37045V10,GM,,GENERAL MTRS CO,COM,3711 +144671,2010-11-19,37045V10,GM,,GENERAL MTRS CO,COM,3711 +144671,2020-07-30,37045V10,GM,,GENERAL MOTORS COMPANY,ORDINARY SHARES,3711 +145665,2010-12-09,33616C10,FRC,,FIRST REP BK SAN FRAN CALI N,COM,6022 +145665,2010-12-10,33616C10,FRC,,FIRST REP BK SAN FRAN CALI N,COM,6022 +145665,2011-06-17,33616C10,FRC,,FIRST REP BK SAN FRAN CALI N,COM,6282 +145665,2012-03-02,33616C10,FRC,,FIRST REP BK SAN FRANCISCO C,COM,6282 +145665,2016-10-10,33616C10,FRC,,FIRST REP BK SAN FRANCISCO C,COM,6022 +145665,2020-11-12,33616C10,FRC,,FIRST REPUBLIC BANK,ORDINARY SHARES,6021 +145682,2010-12-15,33904110,FLT,,FLEETCOR TECHNOLOGIES INC,COM,9999 +145682,2010-12-16,33904110,FLT,,FLEETCOR TECHNOLOGIES INC,COM,6153 +145682,2011-06-14,33904110,FLT,,FLEETCOR TECHNOLOGIES INC,COM,7389 +145682,2020-08-11,33904110,FLT,,FLEETCOR TECHNOLOGIES INC,ORDINARY SHARES,7389 +160586,2012-12-10,00287Y10,ABBV,,ABBVIE INC,COM,2834 +160586,2012-12-11,00287Y10,ABBV,,ABBVIE INC,COM,2834 +160586,2013-01-02,00287Y10,ABBV,,ABBVIE INC,COM,2834 +160586,2020-08-05,00287Y10,ABBV,,ABBVIE INC,ORDINARY SHARES,2834 +161291,2013-02-01,98978V10,ZTS,,ZOETIS INC,CL A,2834 +161291,2013-02-04,98978V10,ZTS,,ZOETIS INC,CL A,2834 +161291,2020-08-07,98978V10,ZTS,,ZOETIS INC,ORDINARY SHARES - CL,2834 +166742,2013-06-19,65249B10,NWSAV,,NEWS CORP NEW,CL A,2711 +166742,2013-07-01,65249B10,NWSA,,NEWS CORP NEW,CL A,2711 +166742,2020-08-12,65249B10,NWSA,,NEWS CORP,ORDINARY SHARES - CL,2711 +189909,2013-12-12,43300A10,HLT,,HILTON WORLDWIDE HLDGS INC,COM,9999 +189909,2013-12-13,43300A10,HLT,,HILTON WORLDWIDE HLDGS INC,COM,7011 +189909,2017-01-04,43300A20,HLT,,HILTON WORLDWIDE HLDGS INC,COM,7011 +189909,2020-08-07,43300A20,HLT,,HILTON WORLDWIDE HOLDINGS IN,ORDINARY SHARES,7011 +204869,2014-07-31,14880610,CTLT,,CATALENT INC,COM,2834 +204869,2014-08-01,14880610,CTLT,,CATALENT INC,COM,2834 +204869,2020-09-01,14880610,CTLT,,CATALENT INC.,ORDINARY SHARES,2834 +207039,2015-04-16,29786A10,ETSY,,ETSY INC,COM,5947 +207039,2017-12-26,29786A10,ETSY,,ETSY INC,COM,5961 +207039,2020-08-07,29786A10,ETSY,,ETSY INC,ORDINARY SHARES,7389 +210772,2017-01-17,G8711010,FTI,,TECHNIPFMC LTD,COM,1311 +210772,2017-01-18,G8711010,FTI,,TECHNIPFMC PLC,COM,1311 +210772,2017-01-24,G8711010,FTI,,TECHNIPFMC PLC,COM,3533 +210772,2017-10-24,G8711010,FTI,,TECHNIPFMC PLC,COM,1389 +210772,2020-07-28,G8711010,FTI,,TECHNIPFMC PLC,ORDINARY SHARES,3533 +210772,2020-09-02,G8711010,FTI,,TECHNIPFMC PLC,ORDINARY SHARES,3533 +211899,2017-09-01,26078J10,DWDP,,DOWDUPONT INC,COM,2821 +211899,2019-06-03,26614N10,DD,,DUPONT DE NEMOURS INC,ORDINARY SHARES,2821 +213561,2019-03-20,26055710,DOW,,DOW INC,ORDINARY SHARES,2821 +213561,2019-04-02,26055710,DOW,,DOW INC,ORDINARY SHARES,2821 +214812,2020-10-09,92888110,VNT,,VONTIER CORPORATION,ORDINARY SHARES,3824 +214905,2020-11-05,99999999,VTRS,,VIATRIS INC,ORDINARY SHARES, +214905,2020-11-10,92556V10,VTRS,,VIATRIS INC,ORDINARY SHARES, +214905,2021-02-08,92556V10,VTRS,,VIATRIS INC,ORDINARY SHARES,6282 diff --git a/test/data/ravenpack_links.csv b/test/data/ravenpack_links.csv new file mode 100644 index 0000000..0cb9c98 --- /dev/null +++ b/test/data/ravenpack_links.csv @@ -0,0 +1,143 @@ +rp_entity_id,ncusip,range_start,range_end +0157B1,023135106,2000-01-01, +03B8CF,604059105,2000-01-01,2002-04-08 +03B8CF,88579Y101,2002-04-08, +067779,143658102,2000-01-01,2003-04-30 +067779,143658300,2000-01-01, +0BC29E,026874107,2000-01-01,2009-07-01 +0BC29E,026874784,2009-07-01, +1490F3,253868103,2004-11-04, +159AE4,49446R109,2000-01-01, +17EDA5,458140100,2000-01-01, +1981BF,755111309,2000-01-01,2001-04-30 +1981BF,755111408,2000-01-01,2001-05-31 +1981BF,755111507,2000-01-01,2020-04-03 +1A3E1B,054937107,2000-01-01,2012-07-26 +1A3E1B,89832Q109,2019-12-09, +1BC12C,37045V100,2010-11-17, +1E169E,78410G104,2017-01-17, +1EBF8D,589331107,2000-01-01,2009-11-06 +1EBF8D,58933Y105,2009-11-06, +22C58E,57772K101,2000-01-01,2021-08-26 +2667B6,75513E101,2020-04-03, +2667B6,913017109,2000-01-01,2020-04-03 +2B49F4,406216101,2000-01-01, +2BAE5F,30040W108,2015-02-19, +2BAE5F,664397106,2000-01-01,2015-02-19 +2DBF98,G96629103,2016-01-05, +2DBF98,G96655108,2001-06-11,2010-01-02 +2DBF98,G96666105,2010-01-02,2016-01-05 +2FEA66,053484101,2000-01-01, +322A44,709631105,2000-01-01,2012-10-01 +322A44,G7S00T104,2014-06-03, +322A44,H6169Q108,2012-10-01,2014-06-03 +37727A,902653104,2007-03-15, +37727A,910197102,2000-01-01,2007-03-15 +3CBA2A,855244109,2000-01-01, +408089,824348106,2000-01-01, +41B0E2,315616102,2000-01-01, +442769,902252105,2000-01-01, +44A4FC,148806102,2014-07-31, +4A5C8D,58155Q103,2000-01-01, +508CFD,628530107,2000-01-01,2020-11-17 +508CFD,92556V106,2020-11-17, +508CFD,N59465109,2001-07-08,2020-11-17 +534E72,718507106,2000-01-01,2002-08-30 +56277A,98956P102,2001-08-07, +56EFC7,093671105,2000-01-01, +57B174,929160109,2000-01-01, +5B6C11,354613101,2000-01-01, +5D02B7,62955J103,2021-01-06, +5D02B7,637071101,2000-01-01,2021-01-06 +5DD486,12572Q105,2008-07-17, +5DD486,167760107,2002-12-06,2008-07-17 +5DE5A5,73278L105,2006-05-19, +5DE5A5,784028102,2000-01-01,2006-05-19 +5E6959,776696106,2000-01-01, +5F9CE3,74834L100,2000-01-01, +60DD84,57060D108,2004-11-05, +6137BF,28176E108,2000-04-03, +619882,46625H100,2000-01-01, +619882,616880100,2000-01-01,2001-05-31 +6284B5,462846106,2000-01-01,2015-01-22 +6284B5,46284V101,2015-01-22, +665D7D,00287Y109,2013-01-02, +66E04A,432848109,2000-01-01,2007-10-24 +66E04A,43300A104,2013-12-12,2017-01-04 +66E04A,43300A203,2017-01-04, +69CE71,126650100,2000-01-01, +6B613D,928881101,2020-10-09, +6BF593,44107P104,2000-01-01, +6ED519,65473P105,2000-01-01, +6F6559,704326107,2000-01-01, +7448A3,913903100,2000-01-01, +751A74,V7780T103,2000-01-01, +76E80F,548661107,2000-01-01, +789ADD,171340102,2000-01-01, +7C4168,78388J106,2000-01-01,2017-01-17 +7E1D5D,871607107,2000-01-01, +890C4E,G87110105,2017-01-17, +8CF6DD,200340107,2000-01-01, +91C82E,526057104,2000-01-01, +91C82E,526057302,2005-02-11, +93F143,880770102,2000-01-01, +940C3D,057224107,2000-01-01,2017-07-05 +940C3D,05722G100,2017-07-05, +94637C,110122108,2000-01-01, +9A02C4,03076C106,2005-10-03, +9C512F,00507K103,2013-01-24,2013-10-01 +9C512F,942683103,2000-01-01,2013-01-24 +9C512F,G0083B108,2013-10-01,2015-06-16 +9C512F,G0177J108,2015-06-16,2020-05-08 +9C5BA5,449669100,2002-10-31,2004-09-30 +9C5BA5,61945A107,2004-09-30,2011-05-25 +9C5BA5,61945C103,2011-05-25, +9CA619,370334104,2000-01-01, +9D30A8,879360105,2000-01-01, +9D5FA4,090572207,2000-01-01, +9F03CF,427866108,2000-01-01, +9F71E5,45865V100,2005-11-16,2013-11-13 +9F71E5,45866F104,2013-11-13, +A23747,44980X109,2006-12-13, +A43906,26875P101,2000-01-01, +A6213D,345370100,2000-01-01,2000-08-02 +A6213D,345370860,2000-08-02, +A6828A,478160104,2000-01-01, +AA98ED,418056107,2000-01-01, +AD3C93,001055102,2000-01-01, +B5DE80,758849103,2001-02-12, +B5DE80,758939102,2000-01-01,2001-02-12 +BA2D83,260557103,2019-04-02, +BFAEB4,172908105,2000-01-01, +C03C8B,98978V103,2013-01-23, +C3BCD5,651229106,2000-01-01, +C4073B,278058102,2000-01-01,2012-11-30 +C4073B,G29183103,2012-11-30, +C5EF8D,037389103,2011-06-13,2012-04-02 +C5EF8D,G0403H108,2020-04-01, +C5EF8D,G0408V102,2012-04-02,2020-04-01 +C7859D,336158100,2000-01-01,2007-09-21 +C7859D,33616C100,2010-12-06, +C8A248,26078J100,2017-09-01,2019-05-31 +C8A248,26614N102,2019-05-31, +D0909F,023551104,2000-01-01,2006-05-09 +D0909F,42809H107,2006-05-09, +D29B44,339041105,2010-12-15, +D54E62,166764100,2000-01-01, +D6489C,68389X105,2000-01-01, +D64C6D,654106103,2000-01-01, +DB06B0,285512109,2000-01-01, +DCD97F,369550108,2000-01-01, +DD1BA1,65249B109,2013-06-21, +DD1BA1,65249B208,2013-06-21, +DD682D,04621X108,2004-02-05, +E10D31,281020107,2000-01-01, +E49AA3,620076109,2002-09-05,2011-01-04 +E49AA3,620076307,2011-01-04, +ECF709,053332102,2000-01-01, +EF1AD9,018581108,2001-06-08, +F1FA25,G3223R108,2000-01-01, +F5D410,15135B101,2001-12-13, +FE89E0,20825C104,2002-09-03, +FF4BA4,962166104,2000-01-01, +FF4C20,29786A106,2015-04-16, diff --git a/test/runtests.jl b/test/runtests.jl index 5a2be56..1652a60 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using SQLite, DataFrames, Dates, Test, CSV +using SQLite, DataFrames, Dates, Test, CSV, Documenter using WRDSMerger ## @@ -179,37 +179,68 @@ println(size(df)) ## -df = link_identifiers(db, [Permno(10104)], [Date(2020)], Cusip, NCusip, GVKey, Ticker, IbesTicker, show_tree=true, colnames=["Cusip" => "cusip", "CIK" => "cik"]) -println(size(df)) -println(df) -@test nrow(df) > 0 - -df = link_identifiers(db, [GVKey(12142), GVKey("012142")], [Date(2020), Date(2020)], Permno, Cusip, NCusip, GVKey, Ticker, IbesTicker) -println(size(df)) -println(df) -@test nrow(df) > 0 - - -df = link_identifiers(db, [CIK(1341439), CIK("0001341439")], [Date(2020), Date(2020)], IbesTicker) -println(size(df)) -println(df) -@test nrow(df) > 0 - -df = link_identifiers(db, [Ticker("ORCL")], [Date(2020)], Permno, Cusip, NCusip, GVKey, Ticker, IbesTicker) -println(size(df)) -println(df) -@test nrow(df) > 0 - -df = link_identifiers(db, [IbesTicker("ORCL")], [Date(2020)], Permno, Cusip, NCusip, GVKey, Ticker, IbesTicker) -println(size(df)) -println(df) -@test nrow(df) > 0 +data_dir = joinpath("data") +files = [ + "crsp_links", + "crsp_comp_links", + "gvkey_cik_links", + "ibes_links", + "option_links", + "ravenpack_links" +] +funs=[ + generate_crsp_links, + generate_comp_crsp_links, + generate_comp_cik_links, + generate_ibes_links, + generate_option_crsp_links, + generate_ravenpack_links +] +for (file, fun) in zip(files, funs) + fun( + DataFrame( + CSV.File(joinpath(data_dir, file * ".csv")) + ) + ) +end +create_all_links() + +# Testing creating types is done with doctest + +@test isa(Permno(47896), Permno) +@test Permno(Permco(20436), Date(2020)) == 47896 +@test isa(WRDSMerger.convert_identifier(Permno, Permco(20436), Date(2020)), Permno) +@test ismissing(Permno(NCusip("46625H21"), Date(2020))) +@test Permco(NCusip("46625H21"), Date(2020)) == 20436 +@test Permco(NCusip6("46625H"), Date(2020)) == 20436 +@test Permno(NCusip("46625H21"), Date(2020); allow_parent_firm=true) == 47896 +@test Permco(NCusip("46625H21"), Date(2020); allow_parent_firm=false) |> ismissing + +@test Permno(NCusip("16161A10"), Date(2020)) == 47896 +@test Permno(NCusip("16161A10"), Date(2020); allow_inexact_date=false) |> ismissing + +# non direct links +@test CIK(IbesTicker("CHL"), Date(2020)) == "0000019617" +@test IbesTicker(CIK("0000019617"), Date(2020)) == "CHL" +@test SecID(CIK("0000019617"), Date(2020)) == 102936 +@test CIK(SecID(102936), Date(2020)) == "0000019617" +@test CIK(NCusip("46625H21"), Date(2020)) == "0000019617" +@test CIK(NCusip("46625H21"), Date(2020); allow_parent_firm=false) |> ismissing +@test CIK(NCusip("16161A10"), Date(2020)) == "0000019617" +@test CIK(NCusip("16161A10"), Date(2020); allow_inexact_date=false) |> ismissing +## -df = link_identifiers(db, IbesTicker.(["ORCL", "ETN", "ETN"]), [Date(2020), Date(2020), Date(2010)], NCusip, Cusip) -println(size(df)) -println(df) -@test nrow(df) == 3 +# Since the data is already loaded, just need to load the necessary packages +DocMeta.setdocmeta!( + WRDSMerger, + :DocTestSetup, + quote + using WRDSMerger, Dates + end; + recursive=true +) +doctest(WRDSMerger) ## df1 = DataFrame(