Search for workfile series in database and fetch with suffix

For questions regarding programming in the EViews programming language.

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

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Search for workfile series in database and fetch with suffix

Postby chester » Fri Oct 28, 2016 8:58 am

I have a page within a workfile containing a bunch of series.
I also have a database with the exact same series (and series names), but the time series data might be a bit outdated.
I'd like to search for each series in my workfile page in my EViews database and fetch those exact series with a "_01" appended as a suffix to the series name. This is for comparison purposes before I update those series in my database. Not sure how to go about this but here is what I'm trying to do.

Code: Select all

pageselect Newdata dbopen(type=eviews) "p:\filepath\database.edb" for !j=1 to count("Newdata") 'How do I find out the total number of series in workfile page? fetch(m, s="01") 'How would I fetch each series? next

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

Re: Search for workfile series in database and fetch with suffix

Postby EViews Gareth » Fri Oct 28, 2016 9:24 am

Use the @wlookup command to retrieve all objects in a page (with options for filters).

Then loop through them and fetch one at a time.

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Re: Search for workfile series in database and fetch with suffix

Postby chester » Fri Oct 28, 2016 10:37 am

The workfile page will not always have the same series and the user will never know how many series are in it.
Is there a way to @wlookup all the series in a workfile without referring to the series names explicitly in an argument?

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

Re: Search for workfile series in database and fetch with suffix

Postby EViews Gareth » Fri Oct 28, 2016 11:15 am

Yes, use "*" as a wildcard.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests