Hey,

I want to generate a new variable out of a variable that is already existing.
However, the existing variable contains a date and I do not know how write the if equation properly. I tried with spaces/without, with "" and without and it does not work.

That is the command:

gen war_recurrence=.
replace war_recurrence =1 if peacefail="31dec2006"
replace war_recurrence = 0 if peacefail !=31dec2006


Thankyou,
There