Export to excel from eviews data file

For questions regarding programming in the EViews programming language.

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

gmn734
Posts: 5
Joined: Thu Aug 08, 2013 2:00 am

Export to excel from eviews data file

Postby gmn734 » Thu Aug 22, 2013 7:29 am

Hi,

I have a basic understanding of Eviews (version 6) and am trying to write a basic program file. Someone will regularly send me data in an eviews db file and i want to extract it to excel. I keep encountering an error that i can't correct.

Code: Select all

!WORKFILE_START=1980 !WORKFILE_END=2020 %DATA_PATH="G:x\y\z" %EVIEWS_FILE="ABC" %EXCEL_OUTPUT="ABC" 'create workfile, fectch all data from db file that contains *uk* wfcreate(wf=%EVIEWS_FILE,page=alldata) a !WORKFILE_START !WORKFILE_END cd %DATA_PATH dbopen fcst0613_eviews6 fetch *uk* copy *uk* 'write to excel file WRITE(T=XLS,T,B2,s=data) %DATA_PATH

I keep encountering the error "Incomplete command in batch mode in "WRITE(T=XLS,T,B2,S=DATA)" that i cannot correct. Can anyone help?

Thanks

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

Re: Export to excel from eviews data file

Postby EViews Gareth » Thu Aug 22, 2013 8:05 am

You need to specify a file name as well as the path.

gmn734
Posts: 5
Joined: Thu Aug 08, 2013 2:00 am

Re: Export to excel from eviews data file

Postby gmn734 » Thu Aug 22, 2013 8:37 am

Thanks Gareth, silly question but how do i do that?

Ive tried the below but it doesnt work

WRITE(T=XLS,T,B2,s=data) %DATA_PATH\%EXCEL_OUTPUT

WRITE(T=XLS,T,B2,s=data) %DATA_PATH(%EXCEL_OUTPUT)

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

Re: Export to excel from eviews data file

Postby EViews Gareth » Thu Aug 22, 2013 8:42 am

Probably:

Code: Select all

WRITE(T=XLS,T,B2,s=data) {%DATA_PATH}\{%EXCEL_OUTPUT}.xls
Note that this only works if there are no spaces in the path or file name (and it looks like there aren't in your case).


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests