Write Command

For questions regarding programming in the EViews programming language.

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

GFXFTS
Posts: 43
Joined: Wed Nov 21, 2018 10:33 am

Write Command

Postby GFXFTS » Mon Jan 27, 2025 3:15 am

Hello,

How can I write a list of variables to just one file with a loop please?

The write command below only saves the last variable, e.g. with "JPY" mentioned in it. Ideally, I would like to have all the variables in one file.

Is there also a way to save it into an existing Excel .xlsx file directly into a certain workbook?

Thanks a lot.

Best wishes,

Günter


for %i EUR CHF GBP JPY

' PPP CPI

' Engle-Granger Cointegration Test

group G_USD_{%i}_PPP log({%i}) log(uspric1001) log({%i}_CPI)
show G_USD_{%i}_PPP
g_USD_{%i}_ppp.coint(method=eg)
equation eq_usd_{%i}_ppp_cpi.ls log({%i}) log(uspric1001) log({%i}_CPI)


eq_usd_{%i}_ppp_cpi.forecast(forcsmpl="1975m01 2025m01") USD_{%i}_PPP_CPI_Fit


write(t=txt,na=,dates) S:\Eviews\Scorecard\Eviews_Series\USD_{%i}_PPP_CPI_Fit.csv USD_{%i}_PPP_CPI_Fit

next

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

Re: Write Command

Postby EViews Gareth » Mon Jan 27, 2025 7:29 am

The WRITE command was depreciated 20 years ago.

Use WFSAVE instead.

With either command, you probably want it outside of the for loop?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests