Page 1 of 1

Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 5:22 am
by alexecon
MacRATS won't let me use a procedure and churns out the dreaded "## CP18. MYPROC is not the Name of a PROCEDURE. (Did you forget to SOURCE?)". MYPROC is in the procedures folder, has a .src file extension. I have SOURCE'd it manually, too. Any ideas?

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 7:36 am
by TomDoan
Can you post a copy of that?

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 10:57 am
by alexecon
I have replaced the (three) linreg commands in BaiPerron.src with linreg(robusterrors,lags=4,lwindow=quadratic,...). Saved it with another name ("baiperronrobust.src").

I'm calling the procedure with the following to get the Bai-Perron test results for a model with just a constant.
OPEN DATA "/[...]/Monthly.xls"
CALENDAR(M) 2001:1
DATA(FORMAT=XLS,ORG=COLUMNS,LEFT=1) 2001:01 2014:12 sers1
SOURCE "c:/Applications/RATS 9.0/Procedures/baiperron.src"
@LSUNIT(LAGS=8,MODEL=CRASH,BREAKS=2,METHOD=GTOS) SERS1
@baiperronrobust(maxbreaks=3,minspan=24,tests,noprint) SERS1
# constant
The code works fine up to and including @lsunit. But it does not like @baiperronrobust...

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 11:20 am
by TomDoan
source path\baiperron.src won't get a procedure that's on baiperronrobust.src.

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 11:34 am
by alexecon
No, of course it won't!

But this does not appear to be the problem, as RATS generates the same error message for even the correctly sourced procedures. Anyway, I will insist until I find the problem.

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 11:57 am
by TomDoan
  1. The name of the file must be exactnameofprocedure.src (case insensitive)
  2. It needs to be on a directory on the procedure search path
  3. You need to make sure you rename the actual procedure the way you want.
If you rename the file, but keep the instruction line in the file as procedure baiperron, even if you get #1 and #2 right, it will load the baiperronrobust.src file but not find the procedure.

Re: Loading/Compiling Procedures

Posted: Fri Dec 04, 2015 11:58 am
by alexecon
OK, the problem was that I'd forgotten to change the name of the procedure IN BaiPerron.src. So, RATS was correctly informing me that I was calling a procedure that did not exist.

EDIT: just seen your response: it was number 3 in this case!

Thanks.