Dear All,
I am trying to replace date if it is in specific range. It works fine for a single year, however I have a data set which has 50 years of data. I could just make 50 line with updated date, however I believe it should be easier way to do it, and I would like to learn it.
My code for a single year:
replace nyear=1962 if inrange(newdate, 196207,196306)
I tried with forval i=1962/2014 and replacing date with `i', however it did not work out as expected. Maybe someone has any ideas? Would appreciate it!
Regards,
Marijus
I am trying to replace date if it is in specific range. It works fine for a single year, however I have a data set which has 50 years of data. I could just make 50 line with updated date, however I believe it should be easier way to do it, and I would like to learn it.
My code for a single year:
replace nyear=1962 if inrange(newdate, 196207,196306)
I tried with forval i=1962/2014 and replacing date with `i', however it did not work out as expected. Maybe someone has any ideas? Would appreciate it!
Regards,
Marijus
Comment