Display program output of bin packing example

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Display program output of bin packing example

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!

 

 

 


Accepted Solutions
Solution
a week ago
PROC Star
Posts: 1,283

Re: Display program output of bin packing example

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


All Replies
PROC Star
Posts: 1,283

Re: Display program output of bin packing example

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.

Occasional Contributor
Posts: 14

Re: Display program output of bin packing example

[ Edited ]

 

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

 

Capture.JPG

 

 

 

 

Solution
a week ago
PROC Star
Posts: 1,283

Re: Display program output of bin packing example

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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