Changes

Jump to navigation Jump to search
DataExtension.sql was last saved in July 2018. The output of this script is masterv1-0.txt (last produced in March 2018), which is the sole input to Datasetup.do. This section therefore traces the construction of masterv1-0.txt.
Key stacks:
*StataStaging4 is an input
*gvkeyyearpatentdata (395213)
*statastaging4, (statastaging4->) LBOSeriesProcessed (556) -> LBODetailsWDurr (1691834)
*StataStaging4 -> NaicsSICBase (36779) & ExchangeOK (16236)
*(StataStaging4,LBODetailsWDurr,gvkeyyearpatentdata,NaicsSICBase | ExchangeOK) -> Master (746856)
gvkeyyearpatentdata appears to have been built for all of COMPUSTAT:
--#########################
--# Build yearslist, GvkeyYear
--#########################
DROP TABLE yearslist;
CREATE TABLE yearslist AS
SELECT generate_series(1975,2017) as year;
--43
DROP TABLE Allgvkeys;
CREATE TABLE Allgvkeys AS
SELECT DISTINCT gvkey FROM patenthistorybase ORDER BY gvkey;
--9191
DROP TABLE GvkeyYear;
CREATE TABLE GvkeyYear AS
SELECT gvkey, year
FROM yearslist, Allgvkeys
ORDER BY gvkey, year;
--395213
 
Key stacks:
*patentexpiry
*cspatentbuys FROM 'cspatentbuys.txt' (304864), which came from usptopad
*cspatentsales FROM 'cspatentsales.txt' (451730), which came from usptopad
*stdcompnames
*assignees -> Patentsassigneessimple 5426556
*(Patentsassigneessimple,MatchOrgnameSelf (loaded from orgnamedctmatched.txt 501232), MatchstdcompnamedctOrgname (loaded from Matchstdcompnamedctorgnamestd.txt 8361,stdcompnames) -> patentgrantgvkey
*patentgrantgvkey (1329006), cspatentbuysutlgvkey (272620) ... -> patentgrantbuy
*(patentgrantbuy,patentsale,patentexpired)-> patenthistorybase (1513045)
==Ed's version from 2018==

Navigation menu