Thank you very much, it works!
After somoe changes I applied the following:
egen nfarm = count(farm),by(year)
summarize nfarm, meanonly
sort year
by year: keep if nfarm == `r(max)'
Kind regards,
Olga
      ____________________________________________________________________________________Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/