I have a program that worked in eviews 4, trying to get everything working in eviews 7.
The problem I have is when I write a file to excel and want the name to reflect the list that has the variables currently being written, I try the following:
FOR %j ListA ListB
WRITE(t=xls, a2, nodates, names) "c:\model\data\Output\US{!j}A" year qtr {%s}
I get 1 file written out named: US{!j}A.XLS
when there should be 2, named USListAA.xls and USlistBA.xls
(the %s is defined in other code and works fine, the data in the file writes correctly, it just doesn't name properly)
I'm pretty sure I have a problem with the way I have the {!j} in the write statement, but can't figure out what.
Thanks for any ideas.
using brackets around a % variable
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: using brackets around a % variable
You should be using wfsave rather than write, but apart from that, you can fix your bug with:
Code: Select all
%filename = "c:\model\data\output\us" + @str(!j) + "A"
WRITE(t=xls, a2, nodates, names) {%filename} year qtr {%s}
Re: using brackets around a % variable
That works - thank you!
Who is online
Users browsing this forum: No registered users and 2 guests
