Page 1 of 1

How to return the last date of workfile

Posted: Tue Jan 22, 2013 12:35 pm
by BrettT
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.

Re: How to return the last date of workfile

Posted: Tue Jan 22, 2013 12:45 pm
by EViews Gareth

Code: Select all

@otod(@obsrange)

Re: How to return the last date of workfile

Posted: Tue Jan 22, 2013 12:52 pm
by BrettT
Thank you very much for the quick reply. It works!