Variable on boundary of summation

Hi dear
I have problem with attached models that I need to have decision variable in lower band or upper band of summation.
in the first model i need to find x,y,z and in second model I need to find x that I know the solution of second model is 5 but I want to solved by gams.
mehryar.png