Page 1 of 1

make series name temporary

Posted: Thu Mar 26, 2015 10:09 am
by dburtis
I want to create a temporary series name that exists only within the program but does not become a permanent series name in the workfile.

A simple (and silly) example is in the following program:

smpl 15q1 19q4
series lemp = log(emp)
'lemp is only an intermediate variable used as part of an expression to create another series; I do not want it as part of the workfile
series dlemp=d(lemp)

Re: make series name temporary

Posted: Thu Mar 26, 2015 10:12 am
by startz
On easy thing is to manually delete the series.

Code: Select all

d lemp

Re: make series name temporary

Posted: Thu Mar 26, 2015 10:26 am
by dburtis
yes, i can delete. In real life, i have created a lot of temporary variables by looping. I can delete them at the appropriate place after done using them, but this is extra code that also has to be positioned properly in the program.

Re: make series name temporary

Posted: Thu Mar 26, 2015 10:52 am
by startz
I don't think there is a really good way to do this. (Gareth?) You can create a local subroutine, in which all the created series disappear at the end of the subroutine. But that's not very helpful if you also want to keep quite a few series.
As a kludge, you could do something like name all your temporary series things like temp_x, temp_y and then use a wildcard delete at the end

Code: Select all

d temp_*

Re: make series name temporary

Posted: Thu Mar 26, 2015 12:09 pm
by EViews Gareth
I don't think there is a really good way to do this. (Gareth?) You can create a local subroutine, in which all the created series disappear at the end of the subroutine. But that's not very helpful if you also want to keep quite a few series.
As a kludge, you could do something like name all your temporary series things like temp_x, temp_y and then use a wildcard delete at the end

Code: Select all

d temp_*
That's what I do.

Re: make series name temporary

Posted: Thu Mar 26, 2015 12:14 pm
by dburtis
ok, that is what i will do. Thanks for the advice.