Use the SQL clause ORDER BY.
PROC SQL;
CREATE TABLE buyerspent AS
SELECT Buyer, sum('Price (RM)'n*unit) AS 'Total Spend (RM)'n
FROM Payment
GROUP BY Buyer
ORDER BY 'Total Spend (RM)'n descending ;
RUN;
SAS is different than other systems. Each variable can have a LABEL associated with it, and that label is shown during output. Meanwhile, the variable can be specified using it's simpler name.
Example
sum('Price (RM)'n*unit) AS total label='Total Spend (RM)' ^^^^^ ^^^^^^^^^^^^^^^^^^ name label
To report on multiple variables it is often better to use a procedure such as REPORT or TABULATE
Example:
data forPresentation;
set myData;
amount = price * unit;
run;
proc tabulate data=forPresentation;
class buyer item;
var amount; table (buyer item), amount; run;
... View more