Hey! (working on SAS Studio)
I am trying to create a set in the proc optmodel body of my program, but so far I haven't been successful.
For small sets is ok to create the sets for variables, parameters in the declaration statement but right now I am working with a problem instance that has 200+ elements in one set and 1300+ in another one, so I wonder if there is a way to create a set from a previous data set I can create beforehand.
Something like this.
Data H; input ids; datalines; 131 199 229 512 ; Run; proc optmodel; set Hubs; Read data H into Hubs=ids;
You almost had it. You just need square brackets around the key column(s):
Read data H into Hubs=[ids];
You might find this book of examples useful for learning about PROC OPTMODEL.
You almost had it. You just need square brackets around the key column(s):
Read data H into Hubs=[ids];
You might find this book of examples useful for learning about PROC OPTMODEL.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.