Dear Statalisters,
In a do editor if I generally write code line by line and execute a few lines in a batch, but not the entire program.
suppose I have the following code :
use master
keep xvar1 yvar fyear ...
tempfile master1
save "`master1'"
use havedata
keep yvar fyear ...
tempfile have1
save "`have1'"
merge 1:1 yvar fyear using "`master1'"
in this case, i thought I am merging have1 with master1
my question is : do I need to issue preserve restore command in between.
It seems to me that temp files must be used in a batch, that is , I can't hight the first 4 lines, then the next 4 , then the 9th line, because when I reach merge statement, the previous temp information will be lost. Am I correct about this?
Regards,
Rochelle
In a do editor if I generally write code line by line and execute a few lines in a batch, but not the entire program.
suppose I have the following code :
use master
keep xvar1 yvar fyear ...
tempfile master1
save "`master1'"
use havedata
keep yvar fyear ...
tempfile have1
save "`have1'"
merge 1:1 yvar fyear using "`master1'"
in this case, i thought I am merging have1 with master1
my question is : do I need to issue preserve restore command in between.
It seems to me that temp files must be used in a batch, that is , I can't hight the first 4 lines, then the next 4 , then the 9th line, because when I reach merge statement, the previous temp information will be lost. Am I correct about this?
Regards,
Rochelle
Comment