How to return the last date of workfile

For questions regarding programming in the EViews programming language.

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

BrettT
Posts: 5
Joined: Tue Jan 22, 2013 12:20 pm

How to return the last date of workfile

Postby BrettT » Tue Jan 22, 2013 12:35 pm

Context: I am programming in Eviews 6 to do rolling forecast for hundreds of series, one series at a time. Hence, I write and call a subroutine in a for loop to handle to the repetition.

When I load a series to the subroutine, I append more years to allow for forecasts of k periods beyond the end date of the series by using

Code: Select all

pagestruct(end=@last+k)
After the forecasts, I want to reset the workfile to have the initial end date (say 2010). Because the my series don't have the same end dates (some 2008, some 2009, etc.), so I can't just write

Code: Select all

pagestruct(end=@last-k)
I wonder if there is a way to return the last date of workfile when it's initially loaded and use

Code: Select all

pagestruct(end=enddate)
to reset the workfile after each iteration of the subroutine? Thanks a lot.

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

Re: How to return the last date of workfile

Postby EViews Gareth » Tue Jan 22, 2013 12:45 pm

Code: Select all

@otod(@obsrange)

BrettT
Posts: 5
Joined: Tue Jan 22, 2013 12:20 pm

Re: How to return the last date of workfile

Postby BrettT » Tue Jan 22, 2013 12:52 pm

Thank you very much for the quick reply. It works!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests