# \[AMPL 24609\] Sets/Parameters Declaration

**URL:** <https://discuss.ampl.com/t/ampl-24609-sets-parameters-declaration/488>\
**Category:** Google Group Mirror\
**Created:** [April 10, 2023, 8:26pm UTC](https://discuss.ampl.com/t/ampl-24609-sets-parameters-declaration/488 "2023-04-10T20:26:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Matovu](https://avatars.discourse-cdn.com/v4/letter/j/a8b319/32.png) [@John\_Matovu](https://discuss.ampl.com/u/John_Matovu)\
**Post date:** [April 10, 2023, 8:26pm UTC](https://discuss.ampl.com/t/ampl-24609-sets-parameters-declaration/488/1 "2023-04-10T20:26:09Z")

</div>

Is there a way of grouping all sets using one word

Instead of:  
set A;  
set B;  
set C;  
I only want to use the word set once like:  
set A,B,C;

This also applies to parameters or variables declaration. It becomes very repetitive if the model has many sets or variables.

John

---

<div class="post-metadata">

**Author:** ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)\
**Post date:** [April 11, 2023, 4:24pm UTC](https://discuss.ampl.com/t/ampl-24609-sets-parameters-declaration/488/2 "2023-04-11T16:24:08Z")

</div>

AMPL does not have a syntax like that; you have to write

```auto
set A;
set B;
set C;

```

The same is true of parameters and variables. It is rare that an AMPL model has a very large number of sets, however; also it is rare to have many simple definitions like `param` `p;` or `var` `x;` without any indexing expressions, bounds, or other qualifications.

Can you give an example of a model that you would like to write, where `set` `A,` `B,` `C;` or `param` `p1,` `p2,` `p3;` would be very helpful? Maybe there is a better way to do it that would not involve so much typing.

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [April 11, 2023, 4:44pm UTC](https://discuss.ampl.com/t/ampl-24609-sets-parameters-declaration/488/3 "2023-04-11T16:44:36Z")

</div>

AMPL does not have a syntax like that; you have to write

```auto
set A;
set B;
set C;

```

The same is true of parameters and variables. It is rare that an AMPL model has a very large number of sets, however; also it is rare to have many simple definitions like “param p;” or “var x;” without any indexing expressions, bounds, or other qualifications.

Can you give an example of a model that you would like to write, where “set A; set B; set C;” or “param p1; param p2; param p3;” would be very helpful? Maybe there is a better way to do it that would not involve so much typing.
