Hello,
Wondering if anyone could help me. I've got an int variable "datesxonset" in format %td. The dates look like "09jan2015". However, some observations are missing that information so "datesxonset" is missing. However, a second data source has the data so I can replace the information. I've tried this:
replace datesxonset = 18dec2014 if id=="COUNTRY-YR-####"
replace datesxonset = 12/18/2014 if id=="COUNTRY-YR-####"
Both of those without and without quotes around the date proposed. None work. The error message is "invalid syntax".
I've tried this as well: gen datesxonset2 = date(datesxonset, "MDY") and that didn't work.
How can I manually replace the variable "datesxonset" with the dates that I have from the second source?
Thanks!
Wondering if anyone could help me. I've got an int variable "datesxonset" in format %td. The dates look like "09jan2015". However, some observations are missing that information so "datesxonset" is missing. However, a second data source has the data so I can replace the information. I've tried this:
replace datesxonset = 18dec2014 if id=="COUNTRY-YR-####"
replace datesxonset = 12/18/2014 if id=="COUNTRY-YR-####"
Both of those without and without quotes around the date proposed. None work. The error message is "invalid syntax".
I've tried this as well: gen datesxonset2 = date(datesxonset, "MDY") and that didn't work.
How can I manually replace the variable "datesxonset" with the dates that I have from the second source?
Thanks!
Comment