# Macro-processing error

**URL:** <https://forum.dynare.org/t/macro-processing-error/25401>\
**Category:** Macro-language\
**Created:** [23 March 2024 10:46 UTC](https://forum.dynare.org/t/macro-processing-error/25401 "2024-03-23T10:46:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [23 March 2024 10:46 UTC](https://forum.dynare.org/t/macro-processing-error/25401/1 "2024-03-23T10:46:43Z")

</div>

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](https://forum.dynare.org/uploads/short-url/bgmQw9VeHbilGuyPFKmyn6AcOsj.mod) (238 Bytes)

Can you help me to solve this error?  
Thank you

---

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [23 March 2024 22:03 UTC](https://forum.dynare.org/t/macro-processing-error/25401/2 "2024-03-23T22:03:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [24 March 2024 10:28 UTC](https://forum.dynare.org/t/macro-processing-error/25401/3 "2024-03-24T10:28:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [24 March 2024 10:45 UTC](https://forum.dynare.org/t/macro-processing-error/25401/4 "2024-03-24T10:45:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [24 March 2024 13:47 UTC](https://forum.dynare.org/t/macro-processing-error/25401/5 "2024-03-24T13:47:06Z")

</div>

I wrote other parts of the model in separate files

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [24 March 2024 13:56 UTC](https://forum.dynare.org/t/macro-processing-error/25401/6 "2024-03-24T13:56:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eisamabodian](https://forum.dynare.org/user_avatar/forum.dynare.org/eisamabodian/32/12023_2.png) [@eisamabodian](https://forum.dynare.org/u/eisamabodian)\
**Post date:** [24 March 2024 15:43 UTC](https://forum.dynare.org/t/macro-processing-error/25401/7 "2024-03-24T15:43:37Z")

</div>

Please upload your latest dynare mod file for better investigation.

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [25 March 2024 08:15 UTC](https://forum.dynare.org/t/macro-processing-error/25401/8 "2024-03-25T08:15:33Z")

</div>

You should have something like

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

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

```

[variables.mod](https://forum.dynare.org/uploads/short-url/jbIuRI2MdnouvMp8CgRAV7g3xU8.mod) (279 Bytes)

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [25 March 2024 13:44 UTC](https://forum.dynare.org/t/macro-processing-error/25401/9 "2024-03-25T13:44:00Z")

</div>

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](https://forum.dynare.org/uploads/short-url/aYbtFqzexnxK4Lep0XeiLHKtJxG.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

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [26 March 2024 08:52 UTC](https://forum.dynare.org/t/macro-processing-error/25401/10 "2024-03-26T08:52:30Z")

</div>

Why don’t you use the code I provided?

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [26 March 2024 10:23 UTC](https://forum.dynare.org/t/macro-processing-error/25401/11 "2024-03-26T10:23:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [26 March 2024 11:39 UTC](https://forum.dynare.org/t/macro-processing-error/25401/12 "2024-03-26T11:39:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![M\_P91](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@M\_P91](https://forum.dynare.org/u/M_P91)\
**Post date:** [28 March 2024 12:54 UTC](https://forum.dynare.org/t/macro-processing-error/25401/13 "2024-03-28T12:54:04Z")

</div>

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](https://forum.dynare.org/uploads/short-url/gfO9pIGnJ3Ew8lOxePfawJVWmql.mod) (1.0 KB)  
[model.mod](https://forum.dynare.org/uploads/short-url/5oX2H2sW3nMJxaSDvefYNXTM6NA.mod) (3.4 KB)  
[parameters.mod](https://forum.dynare.org/uploads/short-url/1AtLeebYRd21nHQ4cgAmIqTcpIZ.mod) (1.5 KB)  
[variables.mod](https://forum.dynare.org/uploads/short-url/jbIuRI2MdnouvMp8CgRAV7g3xU8.mod) (279 Bytes)

Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![jpfeifer](https://forum.dynare.org/user_avatar/forum.dynare.org/jpfeifer/32/5044_2.png) [@jpfeifer](https://forum.dynare.org/u/jpfeifer)\
**Post date:** [1 April 2024 12:39 UTC](https://forum.dynare.org/t/macro-processing-error/25401/14 "2024-04-01T12:39:54Z")

</div>

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

```auto
dynare JEEM2015 -Dpolicy=1

```
