BookmarkSubscribeRSS Feed
TueChristensen
Calcite | Level 5

Hi fellow SAS-users!

After much frustration and a lot of reading up on the proc optmodel and examples I turn to you.

Essentially I am trying, by using sets, to read in some data which varies in the number of elements in several dimension. A simplified example of what I want would is:

data Company_Data;

  input Customer Bill;

  datalines;

  cust1 B1

  cust1 B2

  cust1 B3

  cust2 B4

  cust3 B5

  ;

proc optmodel;

set<string> Customers init {};

set<string> Bills{c in Customers};

read data Company_Data into Customers=[customer];

/*Magic to get Bills read into the model */

?

?

?

/*What I want*/

Customers={'cust1','cust2','cust3'};

Bills['cust1'] = {'B1', 'B2', 'B3'};

Bills['cust2'] = {'B4'};

Bills['cust3'] = {'B5'};

/* End of model */

1 REPLY 1

sas-innovate-2024.png

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.

 

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