<snip>
"So you didn't get the error on the smpl command? I'm puzzled (though
grateful that it works now!) -- I was working with the full data set so realtbill was in
there, and the error was definitely being generated within the function. I'll try to
reproduce it, but in the meantime thanks much."
Bad news -- I reproduced the error. Good news -- I've tracked down the cause.
The data set I've been working on is annual, 1947-2008, which I'm restricting to
1950-2005. So in my main program I have
<hansl>
open annual
smpl 1950 2005
#
# other stuff...
#
list ylist = spot
loop foreach i ylist --quiet
teststats[i] = minmin($i,realtbill,"I",0.5)
endloop
</hansl>
Then the function "minmin" does forward & backward recursive testing. The
problem seems to be related to the smpl command in the main program (ie, the 2nd line
above). If I comment that out, the function works fine. Otherwise I get the error:
Bad character 'b' in date string
error in new starting obs
*** error in function minmin
smpl begdate enddate
I think this didn't happen for Allin when he tested it because the data file I posted
was already sub-sampled to 1950-2005, so the smpl command had no effect.
Things work as expected if I move the smpl command to the function:
<hansl>
function minmin(arguments)
smpl 1950 2005
#
# other stuff
#
end function
open annual
#
# other stuff...
#
list ylist = spot
loop foreach i ylist --quiet
teststats[i] = minmin($i,realtbill,"I",0.5)
endloop
</hansl>
So I've got things working, but I don't understand why the smpl in the original
main program should be generating that error.
PS