Assigning dynamic strings

For questions regarding programming in the EViews programming language.

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

svilen
Posts: 34
Joined: Wed Mar 18, 2009 5:59 am
Location: Sofia, Bulgaria
Contact:

Assigning dynamic strings

Postby svilen » Wed Mar 11, 2015 7:55 am

I would like to have a date string like this:
%date_1 = "2014:4"
and another one depending on former adding one quarter:
%date_2 = "2015:1"
Unfortunately %date_2 = {%date_1}+1 does not work although in: smpl %date_1 %date_2+1 it works.

How to make the second one dependant on the first one using a formula?

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

Re: Assigning dynamic strings

Postby EViews Gareth » Wed Mar 11, 2015 8:40 am

Use the @dateadd function.

The reason you can do %date+2 in a sample statement is that the sample knows the frequency of the workfile, and is able to add that number of units to a date easily. When dealing with arbitrary strings, EViews has no idea what frequency you're interested in, so has no way of adding to it.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests