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

Available on demand!

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

 

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
  • 390 views
  • 0 likes
  • 2 in conversation