# Loop for different sectors with same FOCs and technologies of production

**URL:** <https://forum.dynare.org/t/loop-for-different-sectors-with-same-focs-and-technologies-of-production/21353>\
**Category:** Perfect foresight simulations\
**Created:** [4 November 2022 18:32 UTC](https://forum.dynare.org/t/loop-for-different-sectors-with-same-focs-and-technologies-of-production/21353 "2022-11-04T18:32:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hipa](https://forum.dynare.org/letter_avatar_proxy/v4/letter/h/ad7895/32.png) [@hipa](https://forum.dynare.org/u/hipa)\
**Post date:** [4 November 2022 18:32 UTC](https://forum.dynare.org/t/loop-for-different-sectors-with-same-focs-and-technologies-of-production/21353/1 "2022-11-04T18:32:34Z")

</div>

Good evening,

I have many sectors in my model that have the same technology of production and FOC’s. The only thing that changes are the naming of the variables that are sector specific. For clarity reason of the .mod file, can I have some kind of loop with i defining the name of the 10 sectors, and in the model bloc (and steady state bloc) having just 4 FOC but indices by i to prevent having 4x10 FOCS in the .mod file.

Thank you in advance 🙂

---

<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:** [5 November 2022 07:59 UTC](https://forum.dynare.org/t/loop-for-different-sectors-with-same-focs-and-technologies-of-production/21353/2 "2022-11-05T07:59:23Z")

</div>

See e.g.

> [@Loop over variables instead of parameters in one model](https://forum.dynare.org/t/loop-over-variables-instead-of-parameters-in-one-model/18973/2):
>
> This is a case of using the macro language. Did you have a look at the bkk.mod-example?
