Frequency from Macrobond database?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Frequency from Macrobond database?

Postby paues » Mon Feb 06, 2012 5:44 am

Is it possible to get metadata for a series (e.g. first/last period with data and frequency) in the Macrobond database before copying it to a workfile?

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

Re: Frequency from Macrobond database?

Postby EViews Chris » Mon Feb 06, 2012 10:53 am

There may not be a way to do this at the moment because of limits in the communication between EViews and Macrobond.

On an EViews native database (and some other database formats) you could do the following

string metainfo = @wquery("dbname", "name=gdp", "freq,start,end")

to retrieve the frequency, start date and end date for the series 'gdp' in the database 'dbname'.

I'll check in with the Macrobond development team to see if I'm missing anything.

Chris

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Frequency from Macrobond database?

Postby paues » Tue Feb 07, 2012 3:04 am

It seems that this does not work with a Macrobond database. I will contact them from my end as well.

Also, the function @wquery does not appear to be documented in the reference material to Eviews 7.2.

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

Frequency from Macrobond database?

Postby EViews Gareth » Tue Feb 07, 2012 7:24 am

It was added after the documentation was written :(

ThomasO
Posts: 1
Joined: Fri Feb 10, 2012 1:39 am

Re: Frequency from Macrobond database?

Postby ThomasO » Fri Feb 10, 2012 1:45 am

We have added support for the @wquery function in Macrobond. It will be available in all version after 1.4.40.

Regards,

Thomas O
Macrobond Financial

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Frequency from Macrobond database?

Postby paues » Wed Mar 07, 2012 7:46 am

How do I give the Macrobond database a shorthand name when I open it through a written Eviews program? It works just fine when I open it through the menus (File/Open/Database...). But when I use

Code: Select all

dbopen(type=macrobond) as mb
the shorthand is not mb, as I would expect, but whatever I chose the last time I opened the database through the menus.

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Frequency from Macrobond database?

Postby paues » Wed Mar 07, 2012 8:21 am

Also, is there some way to check that the Macrobond database can indeed be opened before opening it? I have co-workers who do not have Macrobond installed and I would like to give them an error message saying something like "Macrobond has to be installed in order to run this program."

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

Re: Frequency from Macrobond database?

Postby EViews Gareth » Wed Mar 07, 2012 8:54 am

Also, is there some way to check that the Macrobond database can indeed be opened before opening it? I have co-workers who do not have Macrobond installed and I would like to give them an error message saying something like "Macrobond has to be installed in order to run this program."
There isn't something built into EViews that can do it. I suppose you could try opening a Macrobond database straight away, and if it errors, you know it won't work :D

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Frequency from Macrobond database?

Postby paues » Wed Mar 07, 2012 9:08 am

I guess I have to dive into the wondrous world of error handling :twisted:

Do you have any insights on the shortname issue I posted earlier in this thread?

EViews Jason
EViews Developer
Posts: 870
Joined: Tue Sep 16, 2008 3:50 pm

Re: Frequency from Macrobond database?

Postby EViews Jason » Wed Mar 07, 2012 10:06 am

In regards to the shorthand issue, it could be one of several things. The first thing I would try is changing your syntax to

Code: Select all

dbopen(type=macrobond) xx as mb
'xx' is the database name. In the Macrobond case, database name is irrelevant and ignored. So it can be anything. It is needed as a placeholder for the EViews parser. Without the database name, the EViews the parser will get confused.

If you find the shorthand is still not changing, make sure the database is not in the database registry (options->database registry).

If it is not in the database registry, change your default database by opening a second database. For example

Code: Select all

dbopen(t=fred)

paues
Posts: 218
Joined: Fri Apr 15, 2011 7:16 am
Location: Stockholm, Sweden

Re: Frequency from Macrobond database?

Postby paues » Thu Mar 08, 2012 1:19 am

Thank you! The syntax

Code: Select all

dbopen(type=macrobond) xx as mb
worked wonders.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests