Hi

i have a three "MIP" model , i want to solve these model in one GAMS file ,i write equation for every model first, when i write

model my_model1/obj1,c1,c2/;

my_model1.Optfile =1;

file opts cplex option file/ cplex.opt /;

putclose opts /'epgap=0' /'epagap=0';

solve my_model1 using mip minimizing z;

and

model my_model2/obj2,c3,c4/;;

my_model2.Optfile =1;

file opts cplex option file/ cplex.opt /;

putclose opts /'epgap=0' /'epagap=0';

solve my_model2 using mip minimizing z1;

i have this errror "symbol redefined -a second data statement for the same symbol or data statement after an assignment ,

how can fix this problem ?

thanks

## epgap=0

### Re: epgap=0

Hi,

You are using the same file statement twice.
You cannot use the same internal file name ("opts") more than once. Just get rid of the second one and you should be good.

I hope this helps!

Fred

You are using the same file statement twice.

Code: Select all

```
file opts cplex option file/ cplex.opt /;
[...]
file opts cplex option file/ cplex.opt /;
```

I hope this helps!

Fred

### Re: epgap=0

Can you explain a little more?

What exactly should I do?

I did not understand yet

Thanks

What exactly should I do?

I did not understand yet

Thanks

### Re: epgap=0

Richard,

Just change your code to

I hope this helps!

Fred

Just change your code to

Code: Select all

```
model my_model1/obj1,c1,c2/;
my_model1.Optfile =1;
file opts cplex option file/ cplex.opt /;
putclose opts /'epgap=0' /'epagap=0';
solve my_model1 using mip minimizing z;
[...]
model my_model2/obj2,c3,c4/;;
my_model2.Optfile =1;
putclose opts /'epgap=0' /'epagap=0';
solve my_model2 using mip minimizing z1;
```

Fred