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.
string maipualtion
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: string maipualtion
@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
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
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
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: string maipualtion
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...
if you simply want to set the sample, or
if you want an indicator series
Code: Select all
smpl if @instr(itemdesc, "Agg")>0Code: Select all
series hasagg = @instr(itemdesc, "Agg")>0Who is online
Users browsing this forum: No registered users and 2 guests
