Character unrecognized by lexer

Hi guys,
I’ve just starting using Dynare, and I am having a difficult time with my mod file. I get the following error message when I try to run it:

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.3).
Starting preprocessing of the model file …
ERROR: NK.mod: line 37, col 16: character unrecognized by lexer

I tried to look for special characters in the mod file, but I do not find it. Is anyone available to help?

Thanks in advancedados_nk.mat (1.7 KB)
NK.mod (2.4 KB)

When you open your file in a text editor, there are random slashes at the end of each line. There is also meta code at the beginning. None of this should be there.

Any counsel about how to solve this? I am having the same trouble and I do not find how to solve it!

Please provide the file

manage.mod (4.2 KB)
Hello, I have the same problem when I run my code: character unrecognized by lexer
Could you please help me,

At the end of

planner_objective (0.5*l_yy*(y-y_T)^{2}+0.5*l_qq*(q-q_T)^{2}+0.5*l_pi*pi^{2});

you are using curly brackets. Only round brackets are allowed.

I’m having the same issue. The character it’s having an issue with is a ^ which doesn’t seem right…

basic.mod (620 Bytes)

I got this error:

dynare basic
Using 64-bit preprocessor
Starting Dynare (version 4.6.1).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR: basic.mod: line 18, col 27: character unrecognized by lexer
Error using dynare (line 282)
Dynare: preprocessing failed

Hi wam2133,

Th encoding of your file was not correct, as ^ and _ where not properly recognized.
Please, find attached a working version of your file. :slight_smile:
basic.mod (620 Bytes)

You are using the wrong hat. Your hat ˆ is UTF character 710 ( while the correct hat ^ is ASCII character 94. In the same line of code, the hat before the (-1/sigma) is the correct one.

Thank you so much!! That worked.

Use a proper text editor. The parameter settings in these lines do not close with a normal Ascii semicolon.