I have a Stata data set with 12 observations. I want to create a new string variable named group.
From manuals, I think the .do file code should be:
input str8 group
c6_8
c9_11
f12_13
f14_19
f20_50
f51_70
f71
m12_13
m14_19
m20_50
m51_70
m71
end
However, Stata gives error message: "command end is unrecognized" (I think because the .do file already reached the 12th observation and therefore had already exited the input command).
So, I instead tried the code without "end" and it worked correctly. But the do-file editor in v17 may misinterpret all the subsequent lines of the do file (thinking that the input command is still open). I think this is a .do file editor problem rather than a Stata problem.
You all may chuckle, figuring this was too minor to post, but let me mention that I like the Stata .do file editor and its color coding very much. I saves me a bunch of trouble generally, so losing its help for the rest of the .do file is melancholy.
From manuals, I think the .do file code should be:
input str8 group
c6_8
c9_11
f12_13
f14_19
f20_50
f51_70
f71
m12_13
m14_19
m20_50
m51_70
m71
end
However, Stata gives error message: "command end is unrecognized" (I think because the .do file already reached the 12th observation and therefore had already exited the input command).
So, I instead tried the code without "end" and it worked correctly. But the do-file editor in v17 may misinterpret all the subsequent lines of the do file (thinking that the input command is still open). I think this is a .do file editor problem rather than a Stata problem.
You all may chuckle, figuring this was too minor to post, but let me mention that I like the Stata .do file editor and its color coding very much. I saves me a bunch of trouble generally, so losing its help for the rest of the .do file is melancholy.
Comment