Problem with the "Read" Command

For questions regarding programming in the EViews programming language.

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

EDRP
Posts: 1
Joined: Tue Jul 09, 2013 10:30 am

Problem with the "Read" Command

Postby EDRP » Tue Jul 09, 2013 10:57 am

Hello,

I have an excel file saved on a network path (C:\ECONOMIC\Eviews\New_Data.XLS) that I'm trying to read from.

The data is in the third tab of the workbook, the tab is named FIN. On the spreadsheet itself, the data looks like
Code Country Name Mnemonic 1980 etc.
AFG Afghanistan AFG_S_STEXD_IHS #N/A
etc.

In the program file I have the command written as:

Code: Select all

read(t,d2,s=fin) "C:\ECONOMIC\Eviews\New_Data.XLS" 203
However, when I try and run the program, I get an error message that says:

Code: Select all

"No workfile exists- use NEW or OPEN to create or load a workfile in "read(t,d2,s=fin) "C:\ECONOMIC\Eviews\New_Data.XLS" 203"
If I replace the read command with open, then it tells me the file is not found. What's going on here? What mistakes might I be making?

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

Re: Problem with the "Read" Command

Postby EViews Gareth » Tue Jul 09, 2013 11:12 am

Have you already created a workfile prior to using the READ command?

EDCRP
Posts: 1
Joined: Mon May 06, 2013 12:52 pm

Re: Problem with the "Read" Command

Postby EDCRP » Tue Jul 09, 2013 11:25 am

Not in this version of the program, no.

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

Re: Problem with the "Read" Command

Postby EViews Gareth » Tue Jul 09, 2013 1:03 pm

The READ command is used to bring data into an existing workfile, hence the error message.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests