BookmarkSubscribeRSS Feed
sarathgk
Fluorite | Level 6

HI,

 

 i have the following problem

 

for {i in rxid} do;
if is_reprice_allowed[i] = 0 then fix new_mac_price[i] = mac_price[i];
else if is_reprice_allowed[i] = 1 and is_present_in_gpi[i] = 1 then fix new_mac_price[i] = new_mac_price_by_user[i];
else if is_reprice_allowed[i] = 0 and is_present_in_gpi[i] = 1 then do;
new_mac_price[i].lb = lower_bound[i];
new_mac_price[i].ub = upper_bound[i];
end;
end;
con c1 {i in rxid}: n_mac_price[i] =new_mac_price[i];

 

am trying to pass the fixed values to the constraints, but after i  expand

 

con c1:n_mac_price[1]-new_mac_price[2]=0

 

where n_mac_price is unknown for now and new_mac_price is found using the above condition, hence my constraint should be like

 

con c1:n_mac_price[1] = 27 something like this.

 

am i heading in the right direction?please help

 

 

1 REPLY 1
RobPratt
SAS Super FREQ

I don't quite follow why you define variable n_mac_price and variable new_mac_price if you want them to always be equal to each other.

 

To see the EXPAND output closer to what you expect, you can do:

   expand / solve;

The fixed values will be substituted and trivial constraints removed.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 1 reply
  • 707 views
  • 0 likes
  • 2 in conversation