Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

Proc Optmodel Constraint Specification for Non-Existing (not missing) Array-Elements

Accepted Solution Solved
Reply
Super Contributor
Posts: 339
Accepted Solution

Proc Optmodel Constraint Specification for Non-Existing (not missing) Array-Elements

Hello,


If this is a constraint (for proc optmodel) I need:

 

Constraint ExampleSmiley Frustratedum{<v,'123','ABC'> in v_l_m}X[v]*M[v,'123','ABC'];

 

.. but the subscript '123' does not exist for all M[v,l,m]'s. (It's not missing, the entry itself has been left out.)

 

How can I avoid the 'invalid array subscript error'?

 

Thanks&kind regards


Accepted Solutions
Solution
‎09-25-2015 06:23 AM
SAS Employee
Posts: 448

Re: Proc Optmodel Constraint Specification for Non-Existing (not missing) Array-Elements

You could intersect with the index set of M (suppose it is called MSET):

 

Constraint Example: sum{<v,'123','ABC'> in v_l_m inter MSET}X[v]*M[v,'123','ABC'];

View solution in original post


All Replies
Solution
‎09-25-2015 06:23 AM
SAS Employee
Posts: 448

Re: Proc Optmodel Constraint Specification for Non-Existing (not missing) Array-Elements

You could intersect with the index set of M (suppose it is called MSET):

 

Constraint Example: sum{<v,'123','ABC'> in v_l_m inter MSET}X[v]*M[v,'123','ABC'];

Super Contributor
Posts: 339

Re: Proc Optmodel Constraint Specification for Non-Existing (not missing) Array-Elements

Thanks, your answer is of course right. But I think I will have a follow-up question. (The "helpful answer option is gone, I believe.)

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 298 views
  • 0 likes
  • 2 in conversation