Fetching data and overwriting existing data

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

Leontief
Posts: 3
Joined: Mon Oct 28, 2013 8:29 am

Fetching data and overwriting existing data

Postby Leontief » Mon Oct 28, 2013 8:35 am

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!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fetching data and overwriting existing data

Postby EViews Gareth » Mon Oct 28, 2013 8:51 am

You'll have to delete the existing ones first.

Leontief
Posts: 3
Joined: Mon Oct 28, 2013 8:29 am

Re: Fetching data and overwriting existing data

Postby Leontief » Mon Oct 28, 2013 9:08 am

eugh! Was afraid of that. Is there any way to delete something only if it exists? If not, don't delete?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13600
Joined: Tue Sep 16, 2008 5:38 pm

Re: Fetching data and overwriting existing data

Postby EViews Gareth » Mon Oct 28, 2013 9:09 am

The delete command has an option to do that:

Code: Select all

delete(noerr) objname


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest