|
Chapter Contents |
Previous |
Next |
| The COMPUTAB Procedure |
This example shows a more complex report that compares the actual data with the budgeted values. The same input data as in the previous example is used.
The report produced by these statements is shown in Output 9.3.1. The report shows the values for the current month and the year-to-date totals for budgeted amounts, actual amounts, and the actuals as a percentage of the budgeted amounts. The data have the values for January and February. Therefore, the CURMO variable (current month) in the RETAIN statement is set to 2. The values for the observations where the month of the year is 2 (February) are accumulated for the Current Month values. The year-to-date values are accumulated from those observations where the month of the year is less than or equal to 2 (January and February).
/* do a more complex report */
title 'Pro Forma Income Statement';
title2 'XYZ Computer Services, Inc.';
title3 'Budget Analysis';
title4 'Amounts in Thousands';
proc computab data=incomrep;
columns cmbud cmact cmpct ytdbud ytdact ytdpct /
zero=' ';
columns cmbud--cmpct / mtitle='- Current Month: February -';
columns ytdbud--ytdpct / mtitle='- Year To Date -';
columns cmbud ytdbud / 'Budget' f=comma6.;
columns cmact ytdact / 'Actual' f=comma6.;
columns cmpct ytdpct / '% ' f=7.2;
columns cmbud--ytdpct / '-';
columns ytdbud / _titles_;
retain curmo 2; /* current month: February */
rows sales / ' '
'Gross Sales';
rows retdis / 'Less Returns & Discounts';
rows netsales / 'Net Sales' +3 ol;
rows tcos / ' '
'Total Cost of Sales';
rows grosspft / ' '
'Gross Profit' +3;
rows selling / ' '
'Operating Expenses:'
' Selling';
rows randd / ' R & D';
rows general / +3;
rows admin / ' Administrative';
rows deprec / ' Depreciation' ul;
rows operexp / ' ';
rows operinc / 'Operating Income' ol;
rows other / 'Other Income/-Expense' ul;
rows taxblinc / 'Taxable Income';
rows taxes / 'Income Taxes' ul;
rows netincom / ' Net Income' dul;
cmbud = type = 'BUDGET' & month(date) = curmo;
cmact = type = 'ACTUAL' & month(date) = curmo;
ytdbud = type = 'BUDGET' & month(date) <= curmo;
ytdact = type = 'ACTUAL' & month(date) <= curmo;
rowcalc:
if cmpct | ytdpct then return;
netsales = sales - retdis;
grosspft = netsales - tcos;
operexp = selling + randd + general + admin + deprec;
operinc = grosspft - operexp;
taxblinc = operinc + other;
netincom = taxblinc - taxes;
colpct:
if cmbud & cmact then cmpct = 100 * cmact / cmbud;
if ytdbud & ytdact then ytdpct = 100 * ytdact / ytdbud;
run;
Output 9.3.1: Report Using Specifications to Tailor Output
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.