Hello, I am trying to merge the Thomson 13F summary file on Ownership with a quarterly Fundamentals Compustat file. The 13F file only comes with CUSIP as an identifier and while I can merge the two datasets by reducing the CUSIP to either 6 or 8 digits, the data seems to miss certain matches where the firms are the same and observations should exist. I also get the message that: "variable cusip was str10, now str12 to accommodate using data's values"
If I want to use the PERMNO linking table, I face the problem that I do not know how to match them with the right date range. In the linking file, I am provided with 2 variables: the start of the link and the end data. My idea was to duplicate each observation in the linking file on a quarterly basis within the date range. However, I do not know how to do this. But I think that after that, I can match the two files as CUSIP is unique for a particular point in time.
Again, the main goal is to bring together the quarterly fundamentals from the Compustat file with the ownership data which is also quarterly.
Thank you for your help!
Compustat Data
13F File
Linking Table
If I want to use the PERMNO linking table, I face the problem that I do not know how to match them with the right date range. In the linking file, I am provided with 2 variables: the start of the link and the end data. My idea was to duplicate each observation in the linking file on a quarterly basis within the date range. However, I do not know how to do this. But I think that after that, I can match the two files as CUSIP is unique for a particular point in time.
Again, the main goal is to bring together the quarterly fundamentals from the Compustat file with the ownership data which is also quarterly.
Thank you for your help!
Compustat Data
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str6 GVKEY long datadate str10 cusip "001001" 8673 "000165100" "001001" 8765 "000165100" "001001" 8856 "000165100" "001001" 8947 "000165100" "001001" 9039 "000165100" "001001" 9131 "000165100" "001001" 9221 "000165100" "001001" 9312 "000165100" "001001" 9404 "000165100" "001001" 9496 "000165100" "001001" 9586 "000165100" "001003" 8765 "000354100" "001003" 8856 "000354100" "001003" 8947 "000354100" "001003" 9039 "000354100" "001003" 9131 "000354100" "001003" 9251 "000354100" "001003" 9343 "000354100" "001003" 9435 "000354100" "001003" 9527 "000354100" end format %td datadate
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str12 cusip long rdate "00036110" 7395 "00080010" 7395 "00102910" 7395 "00103810" 7395 "00122010" 7395 "00168810" 7395 "00172310" 7395 "00185510" 7395 "00202410" 7395 "00203010" 7395 "00204010" 7395 "00205010" 7395 "00208010" 7395 "00228010" 7395 "00244010" 7395 "00245510" 7395 "00282410" 7395 "00368010" 7395 "00400910" 7395 "00429510" 7395 end format %td rdate
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str6 gvkey str10 cusip long(LINKDT LINKENDDT) "001000" "000032102" 3969 6755 "001001" "000165100" 8663 9708 "001002" "000352104" 4731 4904 "001003" "000354100" 8741 10820 "001004" "000361105" 4497 .e "001005" "000370106" 4779 8431 "001007" "000774109" 5022 6969 "001007" "000774109" 6970 9037 "001008" "000775106" 8637 9918 "001009" "000781104" 8053 13221 "001010" "00099V004" 761 8945 "001010" "00099V004" -3532 760 "001011" "000872309" 8480 13054 "001012" "000874107" 6605 10955 "001013" "000886309" 7014 18627 "001015" "000893107" 8064 9800 "001016" "001015106" 6543 10343 "001016" "001015106" 5053 6542 "001017" "001030105" 4731 13208 "001018" "001032101" 6970 7733 end format %td LINKDT format %td LINKENDDT
Comment