Hello to everyone. I really hope someone can help me with this. I have a dataset in which I am running a code that "resembles" a sort of vlookup. To do that, I took the code from here https://www.statalist.org/forums/for...ror-in-vlookup.
clear input id matchid d_date 102 351 21246 232 283 . 280 426 21244 283 232 21266 351 102 . 426 280 . end tempfile master save `master' * confirm that d_date is unique within id bysort id (d_date): assert d_date[1]==d_date[_N] * create lookup table bysort id (d_date): keep if _n==1 drop matchid rename (id d_date) (matchid d_date_match) tempfile lookup save `lookup' * merge lookup to master use `master', clear merge m:1 matchid using `lookup' sort id list, clean noobs abbreviate(12)
Now everything works perfectly. The problem is that, if I do not write the command "by hand" and simply run a do file, I get an error message (I understood that the error comes from the space at the end of the line code in the do file).
Basically when I run the line in my do file: save `master' or save `lookup', the command also take one space at the end of the line: save `lookup'_ and gives me the following error: invalid file specification
How can I overcome it and just run the do file without beign forced to always write manually the command without spaces?
Thanks in advance!!!
Related Posts with Tempfile and error due to "spaces" at the end of a do-file line
Implementing Wild Bootstrap T Standard Errors in Regression OutputHello everyone I am investigating the effects of an exogenous economic shock on the unsecured credi…
Unbalanced panel data analysisHi dear all i hope you all fine ...i am undergoing a problem in running analysis on the data ,the de…
GLM model with Gamma distribution and log link - residualsDear all, I am new to running the GLM model in Stata. I have healthcare data which is positively ske…
Interactions, Inconsistent resutlsHi all,, I am getting inconsistent results and hope that someone can help me understand the source.…
GLM or Tobit Regression & Forecast for different distributions (incl. zero inflation)Dear Statalists, I'd very much like to hear your opinion on the following. What I’m trying to do: …
Subscribe to:
Post Comments (Atom)
0 Response to Tempfile and error due to "spaces" at the end of a do-file line
Post a Comment