Page 1 of 1

for loop using strings and widcards

Posted: Wed Oct 07, 2015 2:15 pm
by mark
Hi - Using eviews 9 enterprise
I have a dataset where the major identifier (variable) is a string called "projectnum" with a "-" stuck in the middle. Like this:
21838-0004
21838-0007
02101-0005
03901-0001 etc
I'm using a FOR loop AND a WILDCARD to pull each record associated with a specified projectnum - there are over 900 projects (I'm just showing the first string)
It crashes when I get to line 3 of the code listed below with the error message - illegal date 21838 in "SMPL 21838"
Suggestions? Thanks


smpl @all
for %1 ""21838*""
smpl @all if projectnum={%1}
totalbid.statby(nomean, sum, nostd, nocount) test2 worktype
smpl @all
next
stop

Re: for loop using strings and widcards

Posted: Wed Oct 07, 2015 2:23 pm
by EViews Gareth
You can't use a wildcard inside a smpl statement.

Use a string function such as @instr or @left.