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!
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.
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.
Thank you, this works, but is possible to print it in the format of the example as well (see below)?
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.
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!
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.
Ready to level-up your skills? Choose your own adventure.