Dear Stata community

I am having some problems with my data. I want to run a diff-in-diff analysis and I had two files in long-format which I merged together.

I am looking at the effect of shareholder proposals on the performace of companies. One of the files, contains all the shareholder proposals and the other file contais all the rest of the data of the companies. Unfortunately there are some companies which had a shareholder proposal but these companies are non-existend in the other file which contains all the rest of information.

This brings me to my first problem: Is there a command which shows me, which of the companies only have the observation of the shareholder proposal. I do know that I see with the variable _merge, which observations couldn't be matched, however this also happens when I have the data on all the other informations in the year 2008, 2010 and 2011 and of the shareholder proposal in the year 2009 as an example.

Another problem for my analysis is, if there would be the other data on that companie but the shareholder proposal is not surrounded by this other data. So it is before or after the time span in which I have the other data. How can I find out, if this is the case?

Or is it not necessary to drop these observations as they will automatically not be included in my analysis?

My third problem is regarding the matching. I have a clear treatment variable (beeing 1 if the company ever received a shareholder proposal), however it is more difficult regarding the post variable because the proposals happend at different times. I read here: https://www.statalist.org/forums/for...atment-periods that I have to pair the control and the treatment group so I also get post=1 for the control group. This makes completely sense to me and I already found out, with which criteria I have to use.However what I do not know is how I have to do this matching-pairs in stata.

Thank you very much for all your help.