Macro-processing error

Hi, i am a new user of Dynare. After running my mod file the following error occured:

dynare variables.mod
Starting Dynare (version 6.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
Macro-processing error: backtrace…

  • Unknown variable policy
  • binary operation: “variables.mod” line 33, col 5-16
  • @#if: “variables.mod” line 33, col 1 to line 40, col 11
    Preprocessing time: 0h00m17s.
    Error using dynare
    Dynare: preprocessing failed

variables.mod (238 Bytes)

Can you help me to solve this error?
Thank you

You did not define policy.

@#define policy

Altough after this step you can not run the model, because you have only exogenous variables in your dynare and you have not any certain model in your mod file.

Thank you for your response
I defined the policies,
@#if policy “tax”
Z
@#elseif policy “cap-and-trade”
pz
@#elseif policy “intensity”
pz
Z
@#endif;

But it gives this error again

dynare variables.mod
Starting Dynare (version 6.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR in macro-processor: variables.mod:33.12-17: syntax error, unexpected QUOTED_STRING
Preprocessing time: 0h00m30s.
Error using dynare
Dynare: preprocessing failed

Maybe you can help me in solving this error

You did not write any DSGE model in your mod file.

I wrote other parts of the model in separate files

Thank you for your response
I defined the policies,
@#if policy “tax”
Z
@#elseif policy “cap-and-trade”
pz
@#elseif policy “intensity”
pz
Z
@#endif;

But it gives this error again

dynare variables.mod
Starting Dynare (version 6.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR in macro-processor: variables.mod:33.12-17: syntax error, unexpected QUOTED_STRING
Preprocessing time: 0h00m30s.
Error using dynare
Dynare: preprocessing failed

Maybe you can help me in solving this error

Please upload your latest dynare mod file for better investigation.

You should have something like

@#ifndef policy
@#define policy=1
@#endif


@#if policy == 1
    Z
@#elseif policy == 2
    pz
@#elseif policy == 3
    pz
    Z
@#endif

variables.mod (279 Bytes)

Thanks for the reply, yes, the initial code is uploaded as a file, but when I run the file, it gives the error below.
variables.mod (234 Bytes)
Macro-processing error: backtrace…

  • Unknown variable policy
  • binary operation: “variables.mod” line 33, col 5-16
  • @#if: “variables.mod” line 33, col 1 to line 40, col 7
    Preprocessing time: 0h00m06s.
    Error using dynare
    Dynare: preprocessing failed

Why don’t you use the code I provided?

I use the code you provided, it gives this error
Starting Dynare (version 6.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file …
ERROR: eps_A eps_G eps_eta eps_E eps_M not used in model block. To bypass this error, use the nostrict option. This may lead to crashes or unexpected behavior.
Preprocessing time: 0h00m06s.
Error using dynare
Dynare: preprocessing failed

Yes, that is the next problem you have to deal with. The message already instructs you how to override the error.

Yes that’s right .Thank you for your answer
Another question I had is that when I try to run JEEM2015 file, it gives me this error.
Unrecognized function or variable ‘policy’.

Error in JEEM2015.driver (line 1366)
if policy == 1

Error in dynare (line 310)
evalin(‘base’,[fname ‘.driver’]);

Required files are attached
JEEM2015.mod (1.0 KB)
model.mod (3.4 KB)
parameters.mod (1.5 KB)
variables.mod (279 Bytes)

Thanks in advance for your help

You need to pass a macro switch for policy. E.g.

dynare JEEM2015 -Dpolicy=1