Hi all,

I have filtered specific firms based on certain criteria for the fiscal year 2004. On the basis of this fiscal year, I want to compose my full sample (2000-2019). So, actually, my intention is to merge the full sample with the smaller 2004 sample (see extract of 2004 sample below). However, with this merge, I only want to merge (read: maintain) the firms from the 2004 sample and I can't. Does anyone know how to do this?

This is the extract of the 2004 sample:

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double accel_filer_key str10 company_fkey str4 sic_code_fkey float fiscal_year str4 fiscal_ye double auditor_fkey str70 auditor_name double audit_fees
  1336 "0000001800" "2834" 2004 "1231"   3 "Deloitte & Touche LLP"           11257000
 13213 "0000002488" "3674" 2004 "1228"   2 "Ernst & Young LLP"               10400000
 17189 "0000003116" "2834" 2004 "1231"   7 "BDO Seidman LLP"                   342500
 23530 "0000003453" "4400" 2004 "1231"   3 "Deloitte & Touche LLP"            1582060
  4131 "0000004281" "3350" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      12000000
  8589 "0000004447" "2911" 2004 "1231"   2 "Ernst & Young LLP"                8191000
 23656 "0000006201" "4512" 2004 "1231"   2 "Ernst & Young LLP"                2398000
  5075 "0000006769" "1311" 2004 "1231"   2 "Ernst & Young LLP"                3494000
130922 "0000007039" "2911" 2004 "1231" 462 "Moore Stephens Travis Wolff LLP"   131626
 19663 "0000007332" "1311" 2004 "1231"   1 "PricewaterhouseCoopers LLP"        625500
 25207 "0000008063" "3728" 2004 "1231"   2 "Ernst & Young LLP"                 115205
  5872 "0000008868" "2844" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       7700000
 18638 "0000009389" "3411" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       5990000
 35242 "0000009984" "3490" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1612480
 44019 "0000010329" "2511" 2004 "1126"   2 "Ernst & Young LLP"                 727000
 31392 "0000012208" "3826" 2004 "1231"   3 "Deloitte & Touche LLP"            2795200
  1973 "0000012927" "3721" 2004 "1231"   3 "Deloitte & Touche LLP"           30900000
 24982 "0000013239" "2821" 2004 "1231"   3 "Deloitte & Touche LLP"            1700000
  2171 "0000014272" "2834" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      19950000
 18361 "0000014930" "3510" 2004 "1231"   2 "Ernst & Young LLP"                4988000
 15698 "0000016875" "4011" 2004 "1231"   1 "PricewaterhouseCoopers LLP"        773996
  2200 "0000016988" "3861" 2004 "1231"   2 "Ernst & Young LLP"                6385000
  2923 "0000018230" "3531" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      18700000
 18397 "0000018926" "4813" 2004 "1231"   4 "KPMG LLP"                         4600000
 35896 "0000020212" "7948" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1098300
 18301 "0000020520" "4813" 2004 "1231"   4 "KPMG LLP"                         4506820
   908 "0000021344" "2080" 2004 "1231"   2 "Ernst & Young LLP"               23700000
 40493 "0000021535" "3825" 2004 "1228"   2 "Ernst & Young LLP"                 552000
  3586 "0000021665" "2844" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       8800000
 32716 "0000024491" "3011" 2004 "1231"   2 "Ernst & Young LLP"                2848710
 20625 "0000024545" "2082" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1952000
 25590 "0000025445" "3490" 2004 "1231"   3 "Deloitte & Touche LLP"            3131000
 27002 "0000025743" "2834" 2004 "1231" 304 "Causey Demgen & Moore PC/Inc"       10263
 42715 "0000026058" "3672" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1239000
 19171 "0000026172" "3510" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       9200000
 30179 "0000026324" "3590" 2004 "1231"   3 "Deloitte & Touche LLP"            1668000
 39743 "0000027904" "4512" 2004 "1231"   3 "Deloitte & Touche LLP"            4748200
 24705 "0000027996" "2780" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1391500
 34724 "0000029002" "3674" 2004 "1231"  13 "Moss Adams LLP"                    426000
 12360 "0000029669" "2750" 2004 "1231"   3 "Deloitte & Touche LLP"           11047900
 13141 "0000029905" "3530" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      10300000
  2341 "0000029915" "2821" 2004 "1231"   3 "Deloitte & Touche LLP"           17639000
  6831 "0000029989" "7311" 2004 "1231"   4 "KPMG LLP"                        20000000
  2274 "0000030554" "2820" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      18800000
 14964 "0000030625" "3561" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      31053800
 11658 "0000031462" "2840" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       4787000
 17494 "0000033185" "7320" 2004 "1231"   2 "Ernst & Young LLP"                3262420
 18565 "0000033213" "1311" 2004 "1231"   2 "Ernst & Young LLP"                1307420
 28408 "0000034067" "3390" 2004 "1231"   2 "Ernst & Young LLP"                 150000
   354 "0000034088" "2911" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      27600000
 23800 "0000037785" "2800" 2004 "1231"   4 "KPMG LLP"                         2573000
  5694 "0000037996" "3711" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      40900000
 33633 "0000039368" "2891" 2004 "1203"   4 "KPMG LLP"                         1991000
 25083 "0000040211" "4700" 2004 "1231"   2 "Ernst & Young LLP"                2995720
  4965 "0000040533" "3730" 2004 "1231"   4 "KPMG LLP"                        14575400
   346 "0000040545" "3600" 2004 "1231"   4 "KPMG LLP"                        78200000
 32630 "0000040888" "3760" 2004 "1231"   2 "Ernst & Young LLP"                5329000
 13248 "0000040987" "5013" 2004 "1231"   2 "Ernst & Young LLP"                4800000
 77751 "0000041719" "2621" 2004 "1231"   3 "Deloitte & Touche LLP"            1672800
 14826 "0000042582" "3011" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      20041000
 22976 "0000042888" "3561" 2004 "1230"   3 "Deloitte & Touche LLP"             696000
 39776 "0000043196" "4833" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1186000
  4527 "0000045012" "1389" 2004 "1231"   4 "KPMG LLP"                        20000000
 23183 "0000045876" "8900" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       6337700
 20233 "0000046080" "3944" 2004 "1229"   4 "KPMG LLP"                         4728000
  8078 "0000047111" "2060" 2004 "1231"   4 "KPMG LLP"                         2482300
 28827 "0000048039" "2911" 2004 "0731"   2 "Ernst & Young LLP"                1139000
 23437 "0000048898" "3670" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       2283870
 35383 "0000049754" "5812" 2004 "1231"   2 "Ernst & Young LLP"                 639600
  3287 "0000049938" "2911" 2004 "1231"   1 "PricewaterhouseCoopers LLP"        856401
   513 "0000050863" "3674" 2004 "1228"   2 "Ernst & Young LLP"               11167000
  6399 "0000051434" "2621" 2004 "1231"   3 "Deloitte & Touche LLP"           13763000
 26540 "0000051548" "7948" 2004 "1130"   2 "Ernst & Young LLP"                 952675
 16166 "0000051644" "7311" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      81210000
  3228 "0000055785" "2670" 2004 "1231"   3 "Deloitte & Touche LLP"            8677000
 31465 "0000056047" "4400" 2004 "1231"   4 "KPMG LLP"                          899000
 16088 "0000058492" "2510" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       2960030
 30408 "0000059440" "2111" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1731000
  1463 "0000059478" "2834" 2004 "1231"   2 "Ernst & Young LLP"                5200000
 28587 "0000059527" "3540" 2004 "1231"   2 "Ernst & Young LLP"                2285000
 22187 "0000060519" "2400" 2004 "1231"   3 "Deloitte & Touche LLP"            2052780
  7048 "0000062996" "2430" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      23300000
 13183 "0000063276" "3942" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       5853000
 18897 "0000063754" "2090" 2004 "1130"   2 "Ernst & Young LLP"                3700000
  2585 "0000063908" "5812" 2004 "1231"   2 "Ernst & Young LLP"                8700000
 29298 "0000066570" "3842" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       2194140
  1780 "0000066740" "3841" 2004 "1231"   1 "PricewaterhouseCoopers LLP"      11200000
128041 "0000068622" "4813" 2004 "1231"   4 "KPMG LLP"                         5176000
 32200 "0000069488" "3089" 2004 "1231"   2 "Ernst & Young LLP"                1694000
 15426 "0000070318" "8062" 2004 "1231"   4 "KPMG LLP"                         4303000
 15616 "0000070415" "8200" 2004 "1231"   4 "KPMG LLP"                         1020000
 19694 "0000070487" "8731" 2004 "1231"   4 "KPMG LLP"                           80500
 17763 "0000071691" "2711" 2004 "1229"   3 "Deloitte & Touche LLP"            3122000
 36056 "0000071829" "3533" 2004 "1231"   2 "Ernst & Young LLP"                 752750
 13785 "0000072207" "1311" 2004 "1231"   4 "KPMG LLP"                         1518000
 12239 "0000073309" "3312" 2004 "1231"   1 "PricewaterhouseCoopers LLP"       1006080
 31880 "0000073756" "1389" 2004 "1231"   2 "Ernst & Young LLP"                 961000
 30612 "0000074303" "2800" 2004 "1231"   4 "KPMG LLP"                         2235000
  8165 "0000075362" "3711" 2004 "1231"   2 "Ernst & Young LLP"                3860000
 23759 "0000075677" "2650" 2004 "1231"   2 "Ernst & Young LLP"                1092950
end
I want to merger this dataset with the full 2000-2019 unfiltered dataset, but only maintain the firms in the small 2004 dataset. Thank you in advance!