Error using dynare (line 172)

Hi, I am trying to run a model using Dynare. When I try to run the model I receive following message:

dynare CA_BMZ12.mod

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

The file CA_BMZ12.mod could not be located in the “Current Folder”. Check whether you typed in the correct filename
and whether the file is really located in the “Current Folder”.

Current folder is C:\DO NOT DELETE\Macroeconomic Models\mmb-gui-mlab-2.3.2\MMB_OPTIONS, and contains the following mod files:

Error using dynare (line 172)
dynare:: can’t open CA_BMZ12.mod

I don’t know why I cannot run this model. The path should’ve been set up correctly. I don’t know what should be wrong? Can someone help me?

Thanks!

Are you sure that the folder you mention contains the .mod file? Because Dynare cannot locate any .mod file in that folder, see

Current folder is C:\DO NOT DELETE\Macroeconomic Models\mmb-gui-mlab-2.3.2\MMB_OPTIONS, and contains the following mod files:

so there is no .mod file in that folder.

It is not clear to me how paths work under Windows/Matlab… But did you try to put your files in a directory where the folder names composing the path do not have spaces?

Best,
Stéphane

@stepan-a That is not the issue. But I am pretty sure that MMB_OPTIONS is not the subfolder where the MMB stores the mod-files.

I solved the problem by setting a path with subdirectories. However, now i get this message insted:

dynare bra_samba08

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 4.5.6).
Starting preprocessing of the model file …
ERROR: Could not open file: bra_samba08.mod

Error using dynare (line 229)
DYNARE: preprocessing failed

Do you know what might cause this?

That is not a solution. You need to identify the subfolder where the file is and set the active folder to this.

What do you mean? That I have to set a path to the folder of the specfic model that I would like to run?

No, there is a distinction in Matlab between the search path and the active folder.


In the screenshot above, you can see the active folder being C:\Users\Johannes\Downloads\Forum. Here, you need to select the folder where the mod-file is located. It is different from what you set in “Set Path”

Okay thanks! That seems to be a part of the problem. Apparently, Windows automatically opens the mod file by using Media Player, because it thinks that the mod file is a movie … somehow. Do you know an easy way to change the “deafult program” of the mod file type?

I have tried to change the “default program” for mod files. But when I try to change it, the MatLab app doesn’t appear on the screen despite the fact that I have downloaded MatLab. I only get the following options:

You cannot start Matlab by right-clicking on a mod-fiel. You need to start Matlab and open the file from there.

I know that. But apparently Windows thinks that the mod file is a Movie and therefore have set the default program to Media Player which somehow makes MatLab unable to understand that the file contains codes and instead thinks that it is just text. I have attached a photo of it:

I have also facing same problem . when i am trying to open that file matlab start installing.
plz help me . provide appropriate solution.

@chandanc Did you double-click or use the Open-menu of the editor window?

Configuring Dynare …
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

The file example.mod could not be located in the “Current Folder”. Check whether you typed in the correct filename
and whether the file is really located in the “Current Folder”.

Current folder is C:\Windows\System32, and contains the following mod files:

Error using dynare (line 172)
dynare:: can’t open example.mod

cd

C:\Windows\System32
yes i opened script file from this manue. After run the model i am getting this error message.

Please search the forum on how to correctly set your Matlab current path to where the mod-file is located.