Page 1 of 1

string maipualtion

Posted: Fri Jul 16, 2010 9:41 am
by mark
Using EV7.1.
I have 100,000 or so strings that vay in lenght from one to 250 characters. I am attempting to sample using the following code:

genr s4=@wkeep(itemdesc,"*Agg*")

where itemdesc is an alpha series and "*Agg*" is the seach string

When I run it, I get one of two error messages

1) Unmatched paranthesis
2) Overflow or illegal function call

Any advice appreciated.

Re: string maipualtion

Posted: Fri Jul 16, 2010 11:54 am
by EViews Glenn
@wkeep isn't really a series function. It's designed to operate on a string list. What exactly is it that you are trying to do?

Re: string maipualtion

Posted: Wed Jul 21, 2010 11:36 am
by mark
I have 100,000 or so strings that vay in lenght from one to 250 characters. I am attempting to extract the sample of records containing the word "Aggregate" from an unstructured panel data set.

genr s4=@wkeep(itemdesc,"*Agg*")

I can genrate the sample containing only the records containing "Agg" by sampling using

if s4<>""

I get the "Overflow or illegal function call" error message, however the series "s4" does get created and I am able to extract the sample of interest using <>""

If you can suggest a more appropriate command to to extract the sample, it would be greatly appreciated (as I have double digit samples to run)

thanks

Re: string maipualtion

Posted: Wed Jul 21, 2010 12:23 pm
by EViews Glenn
Thinking about it, you could use @wkeep in the context in which you are using it, but I think it's probably overkill since you aren't really processing string lists. Don't quite know why you are getting the error, but the following should do what you want more cleanly...

Code: Select all

smpl if @instr(itemdesc, "Agg")>0
if you simply want to set the sample, or

Code: Select all

series hasagg = @instr(itemdesc, "Agg")>0
if you want an indicator series