Page 1 of 1

sample/string error in subroutine

Posted: Mon Aug 12, 2019 10:02 am
by amrsherif
One of our subroutines is no longer working (although we've made no changes to the code). I've attached the error message.
Specifically, the error is in this line:

series s1adj=s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)

Both %firstdate2 and %firstdate2 are defined properly, and the line "smpl %firstdate1 %firstdate2" works as expected. The command in the attached error message also works fine in the command line.

Any thoughts?

Re: sample/string error in subroutine

Posted: Mon Aug 12, 2019 10:09 am
by EViews Gareth
Hard to say without more context. A simple example seems to work:

Code: Select all

create m 1990 2000 series s1=nrnd series s2=nrnd call foo("1991m01", "1991m02") subroutine foo(string %firstdate1, string %firstdate2) series s1adj = s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2) endsub

Re: sample/string error in subroutine

Posted: Mon Aug 12, 2019 10:17 am
by amrsherif
Thanks for the quick response. The example posted gives me the same error. I managed to work around it by splitting the line into two:

!tempscalar=@elem(s2, %firstdate2)/@elem(s1, %firstdate2)
series s1adj=s1*!tempscalar

Old Code
'series s1adj=s1*@elem(s2, %firstdate2)/@elem(s1, %firstdate2)

I'm using the July 19 build by the way, not sure if this is related.


''''''''''''''''''UPDATE''''''''''''''''''
Updating EViews with the new patch fixed the issue