Hi. In the data below, I have merged two datasets by a common code variable to have the variables Product, year, and merge. I want to identify if there are Product names and years that have no match. Basically a flag for a Product-year group within which there is no _merge==3 value at all. For example, in the data below, the last five observations of ACIPHEX in 2008 should be flagged. Any help will be much appreciated.
Code:
input str35 Product float year1 byte _merge "ACANYA" 2009 1 "ACANYA" 2009 3 "ACANYA" 2010 1 "ACANYA" 2010 3 "ACANYA" 2011 1 "ACANYA" 2011 3 "ACANYA" 2012 1 "ACANYA" 2012 3 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 1 "ACCOLATE" 2007 3 "ACIPHEX" 2007 1 "ACIPHEX" 2007 1 "ACIPHEX" 2007 1 "ACIPHEX" 2007 3 "ACIPHEX" 2007 3 "ACIPHEX" 2007 3 "ACIPHEX" 2008 1 "ACIPHEX" 2008 1 "ACIPHEX" 2008 1 "ACIPHEX" 2008 1 "ACIPHEX" 2008 1
Comment