Formula linked to EIA online database

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

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

dman
Posts: 24
Joined: Mon Jul 18, 2016 10:50 am

Formula linked to EIA online database

Postby dman » Mon Jul 18, 2016 10:55 am

Hello.
I'm having trouble creating a formula, linked to EIA online database.

Code: Select all

frml pwti=eia::pet.rclc1.d
fails, with an error "eia::pet.rclc1.d not defined".

At the same time, creating a link to it works

Code: Select all

fetch(db=eia, link) pet.rclc1.d
rename pet_rclc1_d pwti



I suspect the issue is that EIA has dots in series IDs.

Is there a way to create a formula linked to EIA or there is no way around, and I'll have to update the database manually instead of automatic updates?

Thanks!

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

Re: Formula linked to EIA online database

Postby EViews Gareth » Mon Jul 18, 2016 11:00 am

You're mixing things up. You don't want a frml (or do you?). You just want a database link?
Follow us on Twitter @IHSEViews

dman
Posts: 24
Joined: Mon Jul 18, 2016 10:50 am

Re: Formula linked to EIA online database

Postby dman » Mon Jul 18, 2016 11:23 am

I want a formula, so that it auto-updates when I open the workfile later.
What I want is not the issue though. The issue is that for other online databases (FRED for example) I can specify a formula or a link, and both work. For EIA only a link works.

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

Re: Formula linked to EIA online database

Postby EViews Gareth » Mon Jul 18, 2016 11:44 am

A frml is not something that connects to a database. A frml uses local variables on the right hand side. For example:

Code: Select all

frml Y = X+3+W^2


Whenever X or W change, Y will change automatically.

That has nothing to do with a database link. If you want the series to update from the database when you open the workfile, you set it as a database link. Frmls are something else entirely.
Follow us on Twitter @IHSEViews

dman
Posts: 24
Joined: Mon Jul 18, 2016 10:50 am

Re: Formula linked to EIA online database

Postby dman » Mon Jul 18, 2016 1:00 pm

I'm gonna quote online manual for frml here
One particularly useful feature of auto-updating series is the ability to reference series in databases. The command:
frml gdp = usdata::gdp
creates a series called GDP that obtains its values from the series GDP in the database USDATA. Similarly:
frml lgdp = log(usdata::gdp)
creates an auto-updating series that is the log of the values of GDP in the database USDATA.


I want a file that auto-updates on opening.

So, can you please diagnose why it's working for FRED and not working for EIA?

Thanks

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

Re: Formula linked to EIA online database

Postby EViews Gareth » Mon Jul 18, 2016 1:57 pm

Using a frml to update from an online source like that is going to potentially slow up your copy of EViews dramatically. We should change the documentation to indicate that it is only a sensible idea for local databases.

But, yes, in answer to your underlying question, the issue is that series generation commands will not work with a series with periods in it. You'll have to just create a database link instead (which will do exactly what you want, as far as you've said). There is no need to use a frml.
Follow us on Twitter @IHSEViews

dman
Posts: 24
Joined: Mon Jul 18, 2016 10:50 am

Re: Formula linked to EIA online database

Postby dman » Tue Jul 19, 2016 12:37 pm

For future reference, if anyone comes here via search, it's possible to make frml work with EIA database variables, but one would need to specify a list of aliases for the database.

For the example above, the alias for EIA database will have to be set something like
alias1=PET.RCLC1.D, done via database 'object aliases' view
and then
frml PWTI = EIA::alias1 would work and auto-update on opening.

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

Re: Formula linked to EIA online database

Postby EViews Gareth » Tue Jul 19, 2016 12:44 pm

Nifty, although, again a database link will do the same thing without requiring an alias.
Follow us on Twitter @IHSEViews


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 26 guests