Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-28-2015 04:32 AM
(705 views)

Hello,

how do you define a constraint for a specific set of variales (using "in" not GE or LE, etc.)? For example, instead of:

Con Cns_Ex{c in Components:c="R2"}:Sum{p in Products} X

*Qty[p,c]<=8;

I would like something similar to:

Con Cns_Ex{c in Components:c in ("R2", "R5")}:Sum{p in Products} X

*Qty[p,c]<=8

Thanks&best regards

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Here are two ways (note the curly braces instead of parentheses):

Con Cns_Ex{c in Components:c in {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

Con Cns_Ex{c in Components inter {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

If you know that "R2" and "R5" are both in Components, you can make it even simpler:

Con Cns_Ex{c in {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Here are two ways (note the curly braces instead of parentheses):

Con Cns_Ex{c in Components:c in {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

Con Cns_Ex{c in Components inter {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

If you know that "R2" and "R5" are both in Components, you can make it even simpler:

Con Cns_Ex{c in {"R2", "R5"}}:Sum{p in Products} X

*Qty[p,c]<=8;

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.