Page 1 of 1

@now function?

Posted: Wed Feb 06, 2013 5:06 pm
by Silvana
Eviews 6 user
I want to limit my sample to m 1994 2013 by using the @now function (or some other) so I can say smpl current year minus 20 years to current year

Re: @now function?

Posted: Wed Feb 06, 2013 7:43 pm
by EViews Gareth
I don't have EViews 6 on me, but in EViews 7, you can simply do:

Code: Select all

smpl @now-20 @now
I think it will work in EViews 6 too.

Re: @now function?

Posted: Thu Feb 07, 2013 7:49 am
by Silvana
Thanks Gareth for the speedy response

Here's a snippet of my code

wfcreate(page=input) m 1992 2020

smpl @now-20 @now
(or maybe smpl @now-240 @now because it's monthly)

read(f128,s=upload core) etc.

Kicks off this Error Message--
Error in Sample: Illegal date @NOW in "SMPL @NOW-20 @NOW"

Re: @now function?

Posted: Thu Feb 07, 2013 8:52 am
by EViews Gareth
Seems that functionality wasn't in EViews 6. Have to do it the long way:

Code: Select all

wfcreate(page=input) m 1992 2020 %date1 = @datestr(@dateadd(@now,-20,"YY"),"YYYY-MM-DD") %date2 = @datestr(@now, "YYYY-MM-DD") smpl {%date1} {%date2}