Respectable Professors,

Hope everyone is blessed with good health.

I've panel dataset,

SARS = containing non-zero and zero values and proxy for past exogenous shock

I want to generate a dummy variable that equals one if firm ever experience SARS in its life-span.

The Problem I'm currently facing is: "When I generate the dummy variable by the following command, it only account for the year in which firm have non-zero value"
What I want is: " if a firm has non-zero value, then assign one for all years of that firm"

gen sarsd = 0
replace sarsd = 1 if sars > 0
replace sarsd = 0 if missing(sars)
Kindly help how I generate a dummy variable that equals one for all reported years (FYEAR) of firm (GVKEY) if SARS column report non-zero observation, and zero otherwise.

Thanks