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

Hi,

 

I am new to SAS and tried to set up a bin packing program based on the example from the user's guide (link).

 

The program runs without errors, however, the optimal solution is not printed/displayed.

 

I think that this piece of code is sorting the results:

 

proc sort data=dvd;

by bin;

run;

 

I don't know if a print statement is necessary, it is not stated in the example.

 

Thank you in advance!

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Yes, you can print the results from the created data by adding the step

 

proc print data=dvd noobs;
   by bin;
   sum size;
run;

after the PROC SORT Step.

View solution in original post

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

The PROC SORT step merely sorts the created data. You can use a PRINT Statement in PROC OPTMODEL to print the optimal solution like this

 

print bin size;

However, this is the exact same data as stored in the data set "Dvr", which contains the solution generated.

Hendrik
Calcite | Level 5

 

Thank you, this works, but is possible to print it in the format of the example as well (see below)?

 

Capture.JPG

 

 

 

 

PeterClemmensen
Tourmaline | Level 20

Yes, you can print the results from the created data by adding the step

 

proc print data=dvd noobs;
   by bin;
   sum size;
run;

after the PROC SORT Step.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 350 views
  • 0 likes
  • 2 in conversation