Importing data problem

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator

francesca25
Posts: 4
Joined: Tue Mar 13, 2018 10:00 am

Importing data problem

Postby francesca25 » Tue Mar 13, 2018 10:26 am

I am trying to write a programme that pulls in data from multiple other eviews files into one workfile. The source files are enormous forecasting files (stored in a shared network drive), so I don't want to pull in the whole file as that will slowdown the programme. So I was trying to import just the data from a sheet (although ideally I would import just a series from a sheet). I was using the example layout from the eviews handbook of:

import(c=s) c:\temp\quarterly.xls range="GDP_SHEET" @freq q 1990.

eg: import J:\examplefilename.wf1 range="QBanked" @freq q 1959

And that just will not work, it keeps actually crashing in eviews 9, and when I tried it in my version of eviews 8 (as the source files are in eviews 8 so I thought that could be the problem) it imports the whole file. So I'm obviously doing something wrong but I'm not sure what? I did have to take out the term c=s, as it could not find the file at all with that in. Could that be problem? Is there a substitute phrase I should be using?

Thank you!

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

Re: Importing data problem

Postby EViews Gareth » Tue Mar 13, 2018 10:33 am

Easier to open the other workfiles, then copy from one workfile to the other using the copy command.
Follow us on Twitter @IHSEViews

francesca25
Posts: 4
Joined: Tue Mar 13, 2018 10:00 am

Re: Importing data problem

Postby francesca25 » Tue Mar 13, 2018 1:16 pm

Hi Gareth,

The problem with that is I need to replicate across a minimum of 19 files - and ideally we want to do this for multiple series in the long run. And due to the size of the forecasting files, each one takes a few minutes to open. Copying and pasting is what everyone is individually doing for their countries at the moment. I was trying to come up with a quick central way of doing this.

francesca25
Posts: 4
Joined: Tue Mar 13, 2018 10:00 am

Re: Importing data problem

Postby francesca25 » Wed Mar 14, 2018 3:35 am

Hi Gareth,

So I have followed your advice and it is working, its just a little slow as the programme has to import those big files before it can extract the data. But it is definitely better than nothing, so thank you!

EViews Steve
EViews Developer
Posts: 519
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Importing data problem

Postby EViews Steve » Wed Mar 14, 2018 8:15 am

The IMPORT command will actually support reading from a workfile, like you found. But currently it is limited to only reading in objects on the first page (or maybe default page?) of the workfile. So if there were objects on other pages, you wouldn't be able to get those. We should probably modify IMPORT to support using the RANGE argument to switch pages when reading from a workfile, but for now that does not work.

Gareth's suggestion for opening and performing COPY operations will definitely work, but I have another suggestion.

I haven't tried the following myself, but it's possible that this would be much faster for super large workfiles. It involves using our OLEDB provider to read in specific objects (with page support) into an Excel spreadsheet. And since our OLEDB provider doesn't have to load the entire workfile, it may perform much faster.

1. Open a new Excel spreadsheet.
2. Using our Excel Add-In, import and link all the series objects from all source workfiles. Notice that during the Get Data operation, you can select a source workfile and also switch to a different workfile page before selecting your objects.
3. Save your spreadsheet.
4. Drag the Excel file onto EViews to start a new import. At the end of the import, link the objects so you can easily refresh them if data in the spreadsheet changes.

Now, whenever your workfile data changes, you can open Excel and ask it to refresh the spreadsheet. Once refreshed, you can ask EViews to open the new workfile and upon open allow EViews to refresh all data.

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

Re: Importing data problem

Postby EViews Gareth » Wed Mar 14, 2018 8:41 am

Using the fetch command is probably the most efficient.

Code: Select all

fetch path\filename.wf1::pagename\seriesname
Follow us on Twitter @IHSEViews

dreichs
Posts: 1
Joined: Wed May 09, 2018 11:04 am

Re: Importing data problem

Postby dreichs » Wed May 09, 2018 4:07 pm

In a similar fashion, I am trying to import data on a daily basis, but can't figure out the @freq code I need to use. It works fine when using monthly or quarterly frequency. I use Eviews 8.

wfcreate daily d5 2000 2018

import "\\Global_Fixed_Income\David_R\Fixed_Income\data_EM_GS_model_daily.xlsx" range="eviews_daily!b4:n4791" @freq d 2000 2018

I tried using @freq d5... @freq d(1,5), changing the dates to exact dates, but I get the message: Invalid frequency specification.

Again, I do use a similar code to import monthly and quarterly data without any problem. Many thanks for any guidance provided.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 7 guests