I am failing at a surprisingly simple task. In a csv file I have a date variable (mess_datum) in the format yyyymmdd. When I import the csv to Stata (15), the variable will be imported in long format and displayed correctly. Then all I want is copy this variable, so what I do is just
Code:
gen date = mess_datum
I figured out that clonevar does the trick but I am still wondering what went wrong with generate? I tried several things, for example changing mess_datum to double format first, but no success.
Thanks for your help!
Array
0 Response to Error when using generate to copy variable
Post a Comment