BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Yannic_Wera
Calcite | Level 5

Hello,

I want to combine two conditions to restrict constraint generation :

I try to avoid of having to products without setup timeslot and therefore I want to force that when it is another product the binary flag is force to be 0

 

con setsup {i in produit, j in produit , t in time : i<>j and t > 0} : periode_prod[i,t-1] + periode_prod[j,t] = 0 ;

the question is how to combine the two conditions following the : I'm not sure that the AND is working, I quite sure that it doesn't work

 

Thanks in advance

Yannic

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

The AND is correct, but "i<>j" means max(i,j).  If you want to express that i is not equal to j, please use "i ne j" or "i ^= j" or " i ~= j" instead.

View solution in original post

2 REPLIES 2
RobPratt
SAS Super FREQ

The AND is correct, but "i<>j" means max(i,j).  If you want to express that i is not equal to j, please use "i ne j" or "i ^= j" or " i ~= j" instead.

RobPratt
SAS Super FREQ

And here is an alternative approach:

con setsup {i in produit, j in produit diff {i}, t in time : t > 0} : periode_prod[i,t-1] + periode_prod[j,t] = 0 ;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1046 views
  • 2 likes
  • 2 in conversation