Page 1 of 1

Export to excel from eviews data file

Posted: Thu Aug 22, 2013 7:29 am
by gmn734
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

Re: Export to excel from eviews data file

Posted: Thu Aug 22, 2013 8:05 am
by EViews Gareth
You need to specify a file name as well as the path.

Re: Export to excel from eviews data file

Posted: Thu Aug 22, 2013 8:37 am
by gmn734
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)

Re: Export to excel from eviews data file

Posted: Thu Aug 22, 2013 8:42 am
by EViews Gareth
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).