BookmarkSubscribeRSS Feed
ALexandraJ86
Calcite | Level 5

Hello,

 

I am trying to write a constraint like if product is a then take the type_a column for constraint else take type_b column for product b.
Is it posiible to write a constraint like
con product_limit: if product='a' then something <type_a[i]

else something< type_b;

data commodity;
   input product  type_a type_b; 
   datalines;
a 20  25
a 50  15
a 25  10
b 30  15
b 25  20
b 30  30

;


Thankss!

1 REPLY 1
RobPratt
SAS Super FREQ

Yes, look for "IF-THEN/ELSE expression" in this book of examples.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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
  • 1 reply
  • 673 views
  • 0 likes
  • 2 in conversation