Hi, this is a rather simple syntax question, but if solved can save me a lot of time and make my work much less cumbersome.

I have deterministic OLG models and need to define the number of periods for shocks and for simulation in a generic fashion. That is, instead of writing explicitly “periods 1:10” in the shocks block, for example, I would like to be able to write something like “periods 1:T”, where T is a variable predefined by me. The same goes for “simul (periods = T2)”, where T2 would also be a variable predefined by me.

I tried to solve this problem by using the macroprocessor, but to no avail. The farthest I got was to write:

@#define shocks_length = "1:10"

periods @{shocks_length}

But this does not help at all. The “10” is still explicitly written there and I cannot change it easily whenever I need. I run many different dynare models in my routine (closed economies and open economies) and all of them must have the same number of periods T and T2 at each run (and I want to vary these easily).

Thank you so much for your help.

Best,

Felipe