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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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