Page 1 of 1

Fetching data and overwriting existing data

Posted: Mon Oct 28, 2013 8:35 am
by Leontief
Hi Guys,

I basically want to fetch data from a previous database I have created, rename my forecasts to historical data, then overwrite the previous historical data (which had the same name) Here is the code:

fetch(d=forecast_updaug13_c{%country}) *
copy *_f *_t
rename *_t *

However, I keep getting the error "Variable X" already exists in "Rename *_t *"

Ultimately I just want to fetch all the data in my db and rename anything with _f (e.g. example_f) to without the _f (e.g. example) however, the variable "example" here already exists in the database I'm reading in and it wont let me overwrite it. I would try just fetching the _f data but I need some variables which aren't _f to complete my modelling.

Hope this makes sense, my english isn't the best I know!

Re: Fetching data and overwriting existing data

Posted: Mon Oct 28, 2013 8:51 am
by EViews Gareth
You'll have to delete the existing ones first.

Re: Fetching data and overwriting existing data

Posted: Mon Oct 28, 2013 9:08 am
by Leontief
eugh! Was afraid of that. Is there any way to delete something only if it exists? If not, don't delete?

Re: Fetching data and overwriting existing data

Posted: Mon Oct 28, 2013 9:09 am
by EViews Gareth
The delete command has an option to do that:

Code: Select all

delete(noerr) objname