Published on :
Reporting SASHELP

Profit Report by Year and Product Line

This code is also available in: Deutsch Español Français
This script uses the REPORT procedure to analyze the sashelp.orsales table. It groups data by year and product line (product_line) to display the sum of profits, formatted in dollars.
Data Analysis

Type : SASHELP


Uses the standard example table 'sashelp.orsales'.

1 Code Block
PROC REPORT
Explanation :
Defines the report titles and executes PROC REPORT on sashelp.orsales. The 'year' and 'product_line' columns are used for grouping, and 'profit' is analyzed to display the sum with a monetary format.
Copied!
1title1 'Total profit per year';
2title2 'Separated by Product Line';
3PROC REPORT DATA=sashelp.orsales nowd;
4 column year product_line profit;
5 define year / group;
6 define product_line / group ;
7 define profit / analysis sum FORMAT=dollar15.2;
8 RUN;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.