Page 1 of 1
Formula linked to EIA online database
Posted: Mon Jul 18, 2016 10:55 am
by dman
Hello.
I'm having trouble creating a formula, linked to EIA online database.
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!
Re: Formula linked to EIA online database
Posted: Mon Jul 18, 2016 11:00 am
by EViews Gareth
You're mixing things up. You don't want a frml (or do you?). You just want a database link?
Re: Formula linked to EIA online database
Posted: Mon Jul 18, 2016 11:23 am
by dman
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.
Re: Formula linked to EIA online database
Posted: Mon Jul 18, 2016 11:44 am
by EViews Gareth
A frml is not something that connects to a database. A frml uses local variables on the right hand side. For example:
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.
Re: Formula linked to EIA online database
Posted: Mon Jul 18, 2016 1:00 pm
by dman
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
Re: Formula linked to EIA online database
Posted: Mon Jul 18, 2016 1:57 pm
by EViews Gareth
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.
Re: Formula linked to EIA online database
Posted: Tue Jul 19, 2016 12:37 pm
by dman
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.
Re: Formula linked to EIA online database
Posted: Tue Jul 19, 2016 12:44 pm
by EViews Gareth
Nifty, although, again a database link will do the same thing without requiring an alias.