On Sat, 3 Sep 2016, Summers, Peter wrote:
This is for a JAE replication package, and I just wanted to have
the script clean up the dataset when finished so it's back to the
original state. That's not crucial, and I could just remove the
delete command and leave the "cleanup" to the next user.
I think we must be at cross-purposes here. Why is any cleanup
required? You just don't save the dataset with the temporary
added series, after running your script. The dataset remains
unchanged.
I would say that a replication script should start by opening a
specified datafile, and make no changes to that datafile (though it
may make changes to the dataset in memory).
Be that as it may, here's a little example which shows what's
allowed:
<hansl>
open data4-10
list X = 2 3 4
list sX = square(X)
ols 1 0 X
delete sX
eval sX
</hansl>
The line "delete sX" deletes the three added series, but not the
list sX, which becomes empty. But if we tried "delete X" we would
get "No variables were deleted (some data were in use)". The
relevant series are "in use" in the sense that they're regressors in
the last named model and might be called upon in the context of
tests on that model.
Allin