conditional statement

Problems with syntax of GAMS
Post Reply
nasim
User
User
Posts: 7
Joined: 1 year ago

conditional statement

Post by nasim » 9 months ago

Hello,

I want to create a parameter as below:

Parameter
di(b) dummy for BMPs;
if(l.x2(rt,of,b)GT 0);
di(b)=1;
else di(b)=0;
));

x2(rt,of,b) is one of my variables. But, I get errors as below:

Parameter
528
529 di(b) dummy variable for BMPs;
530 if(l.x2(rt,of,b)GT 0);
**** $142$149,149,149,148,135,10
531 di(b)=1;
532 else di(b)=0;
**** $409
533 ));
**** $408,408

I am wondering if someone could help me with the syntax. Thank you in advance.

User avatar
Renger
Posts: 199
Joined: 2 years ago

Re: conditional statement

Post by Renger » 9 months ago

Hi
You should write X2.L instead of L.X2
Cheers
Renger

nasim
User
User
Posts: 7
Joined: 1 year ago

Re: conditional statement

Post by nasim » 5 months ago

ok, thank you so much

Post Reply