Features: |
PROC REPORT statement options: OUT= COMPUTE statement: with a computed variable as report-item DEFINE statement options: COMPUTED |
Other features: |
CHART procedure |
Data set: | GROCERY |
Format: | $SCTRFMT |
libname proclib
'SAS-library';
options fmtsearch=(proclib);
title;
proc report data=grocery nowd out=profit;
column sector manager department sales Profit;
define profit / computed;
/* Compute values for Profit. */ compute profit; if department='np1' or department='np2' then profit=0.4*sales.sum; else profit=0.25*sales.sum; endcomp; run;
options fmtsearch=(proclib);
proc chart data=profit; block sector / sumvar=profit; format sector $sctrfmt.; format profit dollar7.2; title 'Sum of Profit by Sector'; run;