Hello, I am working with the BRFS data. I am interested in using a variable - Recent HIV testing.


The variable is recorded in month&date format as in 11985 (for January 1985) and 122018 (December 2018).

I want to create a new variable that just records the years from 1985 thru 2018.

I tried todate command -

Code:
todate HIVTSTD3, gen(hivtestdate) p(mmyyyy)
But this only gives me the YEAR with m1, m3 etc as in 1983m12

I will appreciate any help to accomplish this.


thanks - cY