writing indicator variables for Gurobi solver

Hello guys,

I am trying to write an if-like constraint that is like: if the summation of a bunch of variables is 1, then set two other variables equal.

More specifically:

set i /1*3/;
variable z(i);
variable p1,p2;
 if sum(i, z(i)) =e= 1 then p1=e=p2;

How can I write that in Gams? I know somethings about SOS1 variable, however, I haven’t been able to apply them to solve this problem. I do not want to use big-M method as I’ve heard it isn’t accurate and might misbehave in some circumstances.

I’d really appreciate it if you could help. Thank you very much in advance

Regards,
Amirreza