defining a sample with @wunion

For questions regarding programming in the EViews programming language.

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

jgarnier
Posts: 5
Joined: Thu Feb 17, 2011 2:07 am

defining a sample with @wunion

Postby jgarnier » Sat Feb 28, 2015 4:41 am

Hi,
I’d like to add two strings together in order to define the sample.

The following codes work well :
%s = "@all if dep_invest>0"
%s2 = "and rrf>0"
%s3 = @wunion(%s,%s2)
smpl %s3

But when I add a third variable (‘autofi’ here),
%s = "@all if dep_invest>0"
%s2 = "and rrf>0 and autofi>0"
%s3 = @wunion(%s,%s2)
smpl %s3
I get an error message like « error in sample: syntax error in "smpl @all if dep_invest>0 and rrf>0 autofi>0»

note that a simple :
%s = "@all if dep_invest>0 and rrf>0 and autofi>0"
smpl %s
works.

Any clue ?
Thanks in advance! :)

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

Re: defining a sample with @wunion

Postby EViews Gareth » Sat Feb 28, 2015 4:59 am

Don't use @wunion. Just add the strings together with the + symbol

jgarnier
Posts: 5
Joined: Thu Feb 17, 2011 2:07 am

Re: defining a sample with @wunion

Postby jgarnier » Mon Mar 02, 2015 8:53 am

It works. Thanks a lot !
Cheers
J


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests