BookmarkSubscribeRSS Feed
neilxu
Calcite | Level 5

Saw a youtube video yesterday. Ed Hughes showed how to use SUBMIT block with PROC CLP to add one more constraint in OPTMODEL procedure.

His example is too complicated and I have hard time to understand all details.

Is there any simple case which I can start with?

User guide and course note don't have much info.

Thanks

9 REPLIES 9
RobPratt
SAS Super FREQ

Here's an example that uses a SUBMIT block to call a DATA step and PROC GPLOT to plot intermediate solutions during a classical row-generation approach to the TSP:

SAS/OR(R) 13.1 User's Guide: Mathematical Programming

If that example isn't helpful, maybe you can describe what you had in mind.

neilxu
Calcite | Level 5

Thank you Rob.

I did read the part, however the SUBMIT/ENDSUBMIT block is not a constraint. That block takes the outputs and plots a graph.

What I am looking at is to embed a constraint in SUBMIT/ENDSUBMIT block. Any simple example?

Thanks

RobPratt
SAS Super FREQ

I'm not quite sure what you mean by embedding a constraint.  The job shop example shown by Ed uses SUBMIT to call PROC CLP, and the resulting output provides information that can be used to add valid constraints to the MILP model.  Can you provide some more detail about your use case?

neilxu
Calcite | Level 5

Thanks Rob.

The problem is in current OPTMODEL, one of our SAS programmers cannot call expmatrix function. So I rewrote everything in IML with Rick's help. However I am wondering if possible to call expmatrix function in SUBMIT/ENDSUBMIT block. My guess is it's highly possible.

So you are right, the youtube example uses SUBMIT to generate output info that can be used as a constraint. My specific question is: that example is too complicated. Do you have some simple examples I can start with?

Thanks

RobPratt
SAS Super FREQ

Now that PROC OPTMODEL supports FCMP functions and routines, I think the examples from this post will help you:

https://communities.sas.com/message/146656#146656

Note that expmatrix is one of the routines provided by PROC FCMP.

The SUBMIT block is useful, but in this case I think FCMP support is the more appropriate OPTMODEL feature for your needs.

neilxu
Calcite | Level 5

Hi Rob,

thanks for your help. Unfortunately, we are still using SAS9.3.

My thought is: keep the original OPTMODEL, add one more constraint in SUBMIT block.

Can you show me how to use SUBMIT instead of FCMP, for example?

Thanks

RobPratt
SAS Super FREQ

FCMP enablement has actually been hidden for several releases and is officially supported in 13.1.  You might try using it with your earlier release and see if it just works. Using SUBMIT instead would require an indirect approach with multiple solver calls.  And I would need more explicit details about your intended constraint.

neilxu
Calcite | Level 5

Hi Rob,

We tried and it didn't work. We even contact SAS support and raised a ticket. Nor working at this moment.

for example, we are minimize the function

min z=sum{i,j} ( x[i,j] - y[i,j] ) **2

the constraints are, for example:

con condition1{i}: sum{j} x[i,j]=1

now we want to introduce expmatrix(x,3,z) and make sure z is satisfied with some other conditions.

Can you give us an example how to use SUBMIT block?

Thanks

RobPratt
SAS Super FREQ

I'll be glad to help, but I still need more details.  What does your constraint that involves expmatrix look like?  It looks like you have overloaded z as the name your objective function and as the third argument of expmatrix.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 9 replies
  • 2437 views
  • 0 likes
  • 2 in conversation