G0014 : File not found ‘ C:gauss16\examples\expend.prg

I am trying to use ExpEnd, a Gauss program for nonlinear Generalized Method of Moments (GMM) estimation of exponential models with endogenous regressors for cross section and panel data. The package is written by Frank Windmeijer of University of Bristol and is available as open source.

I am getting errors when I run old programs that used to work fine with Gauss 14. I am using Gauss version 16 and I do have MaxLik installed.

When I run the “run” file, a file that specifies the model and that calls the core ExpEnd program, I get the error message “G0014 : File not found ‘ C:gauss16\examples\expend.prg’.

It hence does not find the core program which is strange since it is where I claim it is (at C:\gauss16\examples\expend.prg).

The working directory is set to C:\gauss16\examples\.

 

 

 

8 Answers



0



In cases when a program stops working after moving to a newer version of GAUSS, the problem is usually either:

  1. A file did not get updated to the right location for the new version.
  2. An application was not installed to the new version.
  3. The code was not careful about matching case of file names which is OK, on Windows, but the code is now being run on Linux or Mac.

To diagnose your problem, try adding this code right above the #include:

//See if GAUSS can find 'expend.prg', and where
print searchsourcepath("expend.prg", "");

//Print current working directory in case it was changed by the program
print cdir(0);

If this does not make the problem obvious, copy-and-paste:

  1. The lines from your program starting at the added searchsourcepath and ending with the #include statement.
  2. The printed output from this section of code.
  3. The error message that you receive.

into a response to this question so that we can help.

aptech

1,773


0



Thanks for the swift reply!

When I include the first extra line

print searchsourcepath("expend.prg");

the error message is "G0159 Wrong number of parameters"; the error message points to my command
print searchsourcepath("expend.prg");.

When I enter
print cdir(0);

GAUSS spits out "c:\gauss16\examples" which is, surprise, surprise, the working directory where I put all my files.

 

The two program files I use, “gmm_base.run” that calls “expend.prg”, are both placed in c:\gauss16\examples.

When I run “base_run.run” I get the error “G0014 : File not found ‘C:\gauss16\example\expend.prg”, */’[gmm_base.run, line 77]”. Line 77 is the line that calls “expend.prg”.

Here’s the entire code that calls the program expend.prg that base_run calls and can’t trace. The critical line that call "expend.prg" is the final one:

new;

cls;

speed = hsec;

dataset = "C:\gauss16\examples\data";       /*** name of data set                              ***/

auxset  = "C:\gauss16\examples\auxi";       /*** name of auxiliary data set                    ***/

 

let yvar = Y;           /*** name of dependent variable                    ***/

let xvar = SfijunL1 SfijnunL1 SunL1 SotL1 SgradL1 SsupL1 patL1 lrd lcap;  /*** names of explanatory variables                ***/

let lx   = 0        0         0     0     0       0      0     0   0   ;  /*** lag lenghts of explanatory variables          ***/

 

model = 2;              /*** 0 = levels model                              ***/

/*** 1 = within group mean scaling                 ***/

/*** 2 = quasi differenced model   , default       ***/

 

addit = 1;              /*** 0 = multiplicative moment conditions          ***/

/*** 1 = additive moment conditions  , 1           ***/

/*** only active when model=0                      ***/

 

qdif =0;                /*** 0 = Wooldridge moment conditions               ***/

/*** 1 = Chamberlain moment conditions             ***/

/*** only active when model=2                      ***/

 

devvar = 1;             /*** set to 1 for taking deviations from overall   ***/

/*** means of explanatory variables                ***/

/*** use this for Wooldridge quasi-differencing    ***/

 

lfmy = 0;               /*** 0 = no linear feedback model                  ***/

lfmlag = 0;             /*** # of lags of dep. var.                        ***/

 

seqz = 1;               /*** 0 = no sequential instruments                 ***/

let seqzvar = SfijunL1 SfijnunL1 SunL1 SotL1 SgradL1 SsupL1 patL1 lrd lcap;             /*** names of sequential instruments               ***/

let lseqz1 =  1        1         1     1     1       1      1     1   1   ;             /*** lag length of instrs begin                    ***/

let lseqz2 =  4        4         4     4     4       4      4     4   4   ;             /*** lag length of instrs end                      ***/

 

nonseqz = 1;            /*** 0 = no non-sequential instruments             ***/

let nseqzvar = SunL1i SotL1i SgradL1i SsupL1i;     /*** names of non-sequential instruments - instruments!           ***/

let lnseqz   = 0      0      0        0      ;      /*** lag length of instruments                     ***/

 

let timevar = year;     /*** name of time variable                         ***/

/*** set equal to 0 for cross section analysis     ***/

 

timedum = 1;            /*** 1 = time dummies in model                     ***/

/*** estimated coefficients are d_(t)-d_(t-1)      ***/

/*** in quasi-differenced model                    ***/

 

timez = 1;              /*** 1 = time dummies included in instrument set   ***/

/*** when timedum=0                                ***/

 

lagl = 0;               /*** maximum lag length in the model               ***/

 

llev = 0;               /*** observations with less than lagl+llev+1       ***/

/*** (lagl+llev+2 if model=2)                      ***/

/*** time periods get discarded                    ***/

 

saveres = 1;            /*** 1 = save one- and two-step parameters and     ***/

/*** variance matrices as b1,v1,b2 and v2.fmt      ***/

 

nind = 20;             /*** no. of individual units processed in each read ***/

 

 

ml = 1;                 /*** ml=1 uses MAXLIK 4 routine of GAUSS           ***/

/*** otherwise a simple Newton method is used      ***/

 

alg = 4;                /*** sets _max_Algorithm, eg 2 = BFGS, 4 = NEWTON  ***/

 

sval = 0;               /*** sval=0 sets all starting values to 0          ***/

startvaly = 0.4;        /*** start values for lagged dep. vars.            ***/

let startvalx = 0.5 0.2; /*** start values for expl. vars.                 ***/

startvalc = 0;          /*** start value for constant                      ***/

/*** start values for time dummies are 0           ***/

 

output file =           gmm_base.out on;

 

#include                "C:\gauss16\examples\expend.prg";

 

 



0



My mistake with the searchsourcepath call, sorry about that. Thank you for posting the code, that rules out a few things. Try running these commands and posting the output:

print searchsourcepath("expend.prg", "");
print "------";
print cdir(0);
print "-------";
print filesa("*.prg");

aptech

1,773


0



OK, thanks a lot. Seems everything is in the right place. The output is:

c:\gauss16\examples\expend.prg

------

c:\gauss16\examples

------

expend.prg

 

I of course still get the error message that "expend.prg" is not found.



0



What happens when you enter:

run expend.prg

in the GAUSS Program Input/Output window? It the above 'run' command is successful, change the line to:

#include expend.prg

If the run command fails, then I would suspect that the permissions for the file are not allowing GAUSS to read the file. To test this, try to open the file in GAUSS.

aptech

1,773


0



It's a kind of magic but it seems to work now - well, at least kind of. I am getting yet another error message for which I'll start a new threat.



0



Many thanks for your swift and very helpful replies!!!



0



After running the original file, I found some strange non-printing characters between #include and the file name. With the original:

#include    expend.prg;

I can reproduce the problem you were having. There cannot be more than one space between #include and the file name, in this case, expend.prg.

aptech

1,773

Your Answer

8 Answers

0

In cases when a program stops working after moving to a newer version of GAUSS, the problem is usually either:

  1. A file did not get updated to the right location for the new version.
  2. An application was not installed to the new version.
  3. The code was not careful about matching case of file names which is OK, on Windows, but the code is now being run on Linux or Mac.

To diagnose your problem, try adding this code right above the #include:

//See if GAUSS can find 'expend.prg', and where
print searchsourcepath("expend.prg", "");

//Print current working directory in case it was changed by the program
print cdir(0);

If this does not make the problem obvious, copy-and-paste:

  1. The lines from your program starting at the added searchsourcepath and ending with the #include statement.
  2. The printed output from this section of code.
  3. The error message that you receive.

into a response to this question so that we can help.

0

Thanks for the swift reply!

When I include the first extra line

print searchsourcepath("expend.prg");

the error message is "G0159 Wrong number of parameters"; the error message points to my command
print searchsourcepath("expend.prg");.

When I enter
print cdir(0);

GAUSS spits out "c:\gauss16\examples" which is, surprise, surprise, the working directory where I put all my files.

 

The two program files I use, “gmm_base.run” that calls “expend.prg”, are both placed in c:\gauss16\examples.

When I run “base_run.run” I get the error “G0014 : File not found ‘C:\gauss16\example\expend.prg”, */’[gmm_base.run, line 77]”. Line 77 is the line that calls “expend.prg”.

Here’s the entire code that calls the program expend.prg that base_run calls and can’t trace. The critical line that call "expend.prg" is the final one:

new;

cls;

speed = hsec;

dataset = "C:\gauss16\examples\data";       /*** name of data set                              ***/

auxset  = "C:\gauss16\examples\auxi";       /*** name of auxiliary data set                    ***/

 

let yvar = Y;           /*** name of dependent variable                    ***/

let xvar = SfijunL1 SfijnunL1 SunL1 SotL1 SgradL1 SsupL1 patL1 lrd lcap;  /*** names of explanatory variables                ***/

let lx   = 0        0         0     0     0       0      0     0   0   ;  /*** lag lenghts of explanatory variables          ***/

 

model = 2;              /*** 0 = levels model                              ***/

/*** 1 = within group mean scaling                 ***/

/*** 2 = quasi differenced model   , default       ***/

 

addit = 1;              /*** 0 = multiplicative moment conditions          ***/

/*** 1 = additive moment conditions  , 1           ***/

/*** only active when model=0                      ***/

 

qdif =0;                /*** 0 = Wooldridge moment conditions               ***/

/*** 1 = Chamberlain moment conditions             ***/

/*** only active when model=2                      ***/

 

devvar = 1;             /*** set to 1 for taking deviations from overall   ***/

/*** means of explanatory variables                ***/

/*** use this for Wooldridge quasi-differencing    ***/

 

lfmy = 0;               /*** 0 = no linear feedback model                  ***/

lfmlag = 0;             /*** # of lags of dep. var.                        ***/

 

seqz = 1;               /*** 0 = no sequential instruments                 ***/

let seqzvar = SfijunL1 SfijnunL1 SunL1 SotL1 SgradL1 SsupL1 patL1 lrd lcap;             /*** names of sequential instruments               ***/

let lseqz1 =  1        1         1     1     1       1      1     1   1   ;             /*** lag length of instrs begin                    ***/

let lseqz2 =  4        4         4     4     4       4      4     4   4   ;             /*** lag length of instrs end                      ***/

 

nonseqz = 1;            /*** 0 = no non-sequential instruments             ***/

let nseqzvar = SunL1i SotL1i SgradL1i SsupL1i;     /*** names of non-sequential instruments - instruments!           ***/

let lnseqz   = 0      0      0        0      ;      /*** lag length of instruments                     ***/

 

let timevar = year;     /*** name of time variable                         ***/

/*** set equal to 0 for cross section analysis     ***/

 

timedum = 1;            /*** 1 = time dummies in model                     ***/

/*** estimated coefficients are d_(t)-d_(t-1)      ***/

/*** in quasi-differenced model                    ***/

 

timez = 1;              /*** 1 = time dummies included in instrument set   ***/

/*** when timedum=0                                ***/

 

lagl = 0;               /*** maximum lag length in the model               ***/

 

llev = 0;               /*** observations with less than lagl+llev+1       ***/

/*** (lagl+llev+2 if model=2)                      ***/

/*** time periods get discarded                    ***/

 

saveres = 1;            /*** 1 = save one- and two-step parameters and     ***/

/*** variance matrices as b1,v1,b2 and v2.fmt      ***/

 

nind = 20;             /*** no. of individual units processed in each read ***/

 

 

ml = 1;                 /*** ml=1 uses MAXLIK 4 routine of GAUSS           ***/

/*** otherwise a simple Newton method is used      ***/

 

alg = 4;                /*** sets _max_Algorithm, eg 2 = BFGS, 4 = NEWTON  ***/

 

sval = 0;               /*** sval=0 sets all starting values to 0          ***/

startvaly = 0.4;        /*** start values for lagged dep. vars.            ***/

let startvalx = 0.5 0.2; /*** start values for expl. vars.                 ***/

startvalc = 0;          /*** start value for constant                      ***/

/*** start values for time dummies are 0           ***/

 

output file =           gmm_base.out on;

 

#include                "C:\gauss16\examples\expend.prg";

 

 

0

My mistake with the searchsourcepath call, sorry about that. Thank you for posting the code, that rules out a few things. Try running these commands and posting the output:

print searchsourcepath("expend.prg", "");
print "------";
print cdir(0);
print "-------";
print filesa("*.prg");
0

OK, thanks a lot. Seems everything is in the right place. The output is:

c:\gauss16\examples\expend.prg

------

c:\gauss16\examples

------

expend.prg

 

I of course still get the error message that "expend.prg" is not found.

0

What happens when you enter:

run expend.prg

in the GAUSS Program Input/Output window? It the above 'run' command is successful, change the line to:

#include expend.prg

If the run command fails, then I would suspect that the permissions for the file are not allowing GAUSS to read the file. To test this, try to open the file in GAUSS.

0

It's a kind of magic but it seems to work now - well, at least kind of. I am getting yet another error message for which I'll start a new threat.

0

Many thanks for your swift and very helpful replies!!!

0

After running the original file, I found some strange non-printing characters between #include and the file name. With the original:

#include    expend.prg;

I can reproduce the problem you were having. There cannot be more than one space between #include and the file name, in this case, expend.prg.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.