BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Prabhavanth
Calcite | Level 5

Could anyone please explain what difference does a fix statement make in the optmodel procedure?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
user24feb
Barite | Level 11

Initial value vs. actually fixed value. Compare results.

Proc optmodel;
var x;
x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

Proc optmodel;
var x;
fix x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

View solution in original post

4 REPLIES 4
user24feb
Barite | Level 11

It sets/fixes a variable to a certain value.

 

Exactly as in:

 

 proc optmodel;
      var x{1..10};
      fix x = 0;
      fix x[10] = 1;

 

From: http://support.sas.com/documentation/cdl/en/ormpug/66851/HTML/default/viewer.htm#ormpug_optmodel_syn...

Prabhavanth
Calcite | Level 5

Thanks for the reply.

 

But, what's the diffrence between the following two programs?

 

1)

Proc optmodel;

var x;

x=2;

put x=;

quit;

 

2)

Proc optmodel;

var x;

fix x=2;

put x=;

quit;

user24feb
Barite | Level 11

Initial value vs. actually fixed value. Compare results.

Proc optmodel;
var x;
x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;

Proc optmodel;
var x;
fix x=2;
con con: x<=10;
max obj=x;
solve;
put x=;
quit;
Prabhavanth
Calcite | Level 5

It now explains. Thanks a lot.

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
  • 4 replies
  • 1136 views
  • 1 like
  • 2 in conversation