@wkeep

For questions regarding programming in the EViews programming language.

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

KUN0
Posts: 51
Joined: Thu Feb 23, 2012 9:17 am

@wkeep

Postby KUN0 » Tue Apr 10, 2012 12:32 pm

I'm having trouble using the @wkeep command within a loop. Specifically:

%seriesnames = "AU_KEY_PICPI_NSA_Q BR_KEY_PICPI_NSA_M CA_KEY_PICPI_SA_M CH_KEY_PICPI_NSA_M EZ_KEY_PICPI_NSA_M FR_KEY_PICPI_SA_M GE_KEY_PICPI_SA_M HK_KEY_PICPI_SA_M IN_KEY_PICPI_NSA_M IT_KEY_PICPI_NSA_M JP_KEY_PICPI_SA_M KO_KEY_PICPI_NSA_M MX_KEY_PICPI_NSA_M NO_KEY_PICPI_SA_M NZ_KEY_PICPI_NSA_Q PT_KEY_PICPI_NSA_M RU_KEY_PICPI_NSA_M SE_KEY_PICPI_NSA_M SG_KEY_PICPI_NSA_M SP_KEY_PICPI_NSA_M SW_KEY_PICPI_NSA_M TW_KEY_PICPI_NSA_M UK_KEY_PICPI_NSA_M US_KEY_PICPI_SA_M ZA_KEY_PICPI_NSA_M"

%ask="us"
for %filter {%ask}
%wild=%filter+"*"
string check=%wild
string foundnames=@wkeep(%seriesnames,%wild)
string foundnames2=@wkeep(%seriesnames,"US*")
next

The idea is to isolate US_KEY_PICPI_SA_M from my list but any which way I use the %wild string, I get a syntax error. The plan is to eventually add more countries to %ask which is why I am doing it this way.

Any ideas?

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

Re: @wkeep

Postby EViews Gareth » Tue Apr 10, 2012 1:25 pm

It is capiltalisation sensitive. Change "us" to "US".

KUN0
Posts: 51
Joined: Thu Feb 23, 2012 9:17 am

Re: @wkeep

Postby KUN0 » Wed Apr 11, 2012 5:30 am

Cool. Thanks!


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests