This is the point: Yes, but (only) by save. (It would be interesting to be wrong on this.)
-
Login or Register
- Log in with
* about to change the data in memory
preserve
keep `gr' `varlist'
if strpos("`md'", "m") == 0 {
bysort `gr' `varlist': keep if _n == 1 // drop duplicates
}
isid `gr' `varlist', sort
.... (Program syntax)
* save work
tempfile work
qui save "`work'"
* restore original data
restore
merge m:1 `gr' `varlist' using "`work'", assert(match) nogen
isid `gr' `varlist', sort
by `gr' `varlist': gen byte `temp' = _n [...] merge 1:1 `gr' `varlist' `temp' using "`orgfile'"
process using "filename.dta", replace
global S_FN = <the name of the file at the start of my program>

Comment