Bad Date Format

For questions regarding programming in the EViews programming language.

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

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

Bad Date Format

Postby bhaupt » Thu Sep 16, 2010 9:36 am

I am using the latest version of EViews 7.1

I generate a new sample based on a calculated offset which I am adding to the the string definition of my lower sample bound. This works, but my new sample bound looks like 1999m01+5 @last - which is not impossible to read, but starts to be tough for passing to a subroutine. As such, I'm looking to create a new datestring "1999m06" set my bound.

Code: Select all

%beg_hist = "1999m01" !begsmpl = 5 %test_bound = @datestr(@dateadd(@dateval(%beg_hist),!begsmpl,"mm"),"yyyy[M]period")
@dateval(%beg_hist) converts %beg_hist to an appropriate value.
@dateadd adds !begsmpl (5 months) to that value.
but @datestr returns a Bad date format 'yyyy[M]period' in "%MINE = @DATESTR(@DATEADD(@DATEVAL("1989M03"),232,"MM"),"YYYY[M]PERIOD")".

Any date formatting seems to return this result. To my knowledge I've got the inner part right and I'm just stuck with the @datestr at this point. Any assistance on how to get %test_bound to translate properly to "1999m06" would be appreciated.

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

Re: Bad Date Format

Postby EViews Gareth » Thu Sep 16, 2010 9:43 am

I think you want:

Code: Select all

%test_bound = @datestr(@dateadd(@dateval(%beg_hist),!begsmpl,"mm"),"yyyy[M]MM")

bhaupt
Posts: 25
Joined: Fri May 07, 2010 1:16 pm

Re: Bad Date Format

Postby bhaupt » Thu Sep 16, 2010 10:48 am

Wow. I'd swear I had written that at one point. Gareth, your help is much appreciated.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests