A few things about Database

For making suggestions and/or requests for new features you'd like added to EViews.

Moderators: EViews Gareth, EViews Moderator

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

A few things about Database

Postby tchaithonov » Thu Apr 15, 2010 12:40 pm

Hi Guys,

As you should have discovered, I have been working a lot on the Eviews database functions lately. I was just reading the manual, trying to find a way to automate economic data gathered from various sources (Fred via database function, stock indices via the new add-in for instance) and store them into a different database (where my workfiles will eventually link to for data). I wrote a couple of lines and then I have no idea what to do next:

Code: Select all

dbopen(type=fred) fred for %data FEDFUNDS GDP DSPI PMSAVE ' ?????? next
The question marks are intentional and it represents the core of my question. As you can see, I am trying to get 4 econ variables from Fred database but I can't really use fetch since it means that I will first need to create a separate workfile for each of these variables while not knowing the date begin and date ending of them. What I am looking for is a way to skip the workfile stage completely, so that I could just collect the requested variables from Fred and throw them directly into the final database.

I know I could use the import function, just like how the add-in is done; in fact, since Fred's txt file URLs are much simpler, it may be even easier than what's done for the stock download add-in. The problem with that is with the multi-line headers in all of Fred's files. I tried and failed to have any success in removing headers like this for csv/txt files. So, if you have any workarounds/new ideas about how this could be done, please let me know. Thanks.

Tchaithonov

EViews Chris
EViews Developer
Posts: 161
Joined: Wed Sep 17, 2008 10:39 am

Re: A few things about Database

Postby EViews Chris » Thu Apr 15, 2010 1:48 pm

I think what you're looking for is the 'copy' command. This can move objects between two databases as well as from databases to workfiles.

Code: Select all

dbopen(type=fred) fred dbcreate localdb for %data FEDFUNDS GDP DSPI PMSAVE copy fred::{%data} localdb::{%data} next

tchaithonov
Posts: 168
Joined: Mon Apr 13, 2009 7:39 am
Location: New York City

Re: A few things about Database

Postby tchaithonov » Thu Apr 15, 2010 8:52 pm

Hmm .... I should have thought about that ... must not have thought out of the right mind this afternoon .... Thanks Chris...

fmramos
Posts: 116
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil

Re: A few things about Database

Postby fmramos » Thu May 06, 2010 2:21 pm

Great point!

I've been used to get series creating a kind of temp workfile instead of direct copying data.

Tks!

Fabio

fmramos
Posts: 116
Joined: Fri Sep 19, 2008 7:30 am
Location: Sao Paulo / Brazil

Re: A few things about Database

Postby fmramos » Mon May 17, 2010 11:24 am

Hi guys!

I've started to use these tips for external databases, specially Ecowin data.

Is it possible to change series names? when copying to local databases?

For instance,
"for %data usa04405" (usa04405 is EWin's name)

change 'usa04405' to another name (eg. 'pmi_chicago')?

Tks in advance,

Fabio

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

Re: A few things about Database

Postby EViews Gareth » Mon May 17, 2010 11:38 am

If you're using the copy command, you can explicitly state the name of the object you want to create (i.e. rename it).

Code: Select all

copy fred::usa04405 localdb::pmi_chicago


Return to “Suggestions and Requests”

Who is online

Users browsing this forum: No registered users and 1 guest