The COMPUTAB Procedure

Example 9.3 Comparison of Actual and Budget

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).

data incomrep;
   length type $ 8;
   input type :$8. date :monyy7.
         sales retdis tcos selling randd
         general admin deprec other taxes;
   format date monyy7.;
datalines;
BUDGET JAN1989 4600 300 2200 480 110 500 210 14 -8 510
BUDGET FEB1989 4700 330 2300 500 110 500 200 14  0 480
BUDGET MAR1989 4800 360 2600 500 120 600 250 15  2 520
ACTUAL JAN1989 4900 505 2100 430 130 410 200 14 -8 500
ACTUAL FEB1989 5100 480 2400 510 110 390 230 15  2 490
;
title  'Pro Forma Income Statement';
title2 'XYZ Computer Services, Inc.';
title3 'Budget Analysis';
title4 'Amounts in Thousands';

options linesize=96;
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 That Uses Specifications to Tailor Output

Pro Forma Income Statement
XYZ Computer Services, Inc.
Budget Analysis
Amounts in Thousands

   --- Current Month: February ---                            -------- Year To Date ---------   
      Budget     Actual        %                                 Budget     Actual        %     
   ---------  ---------  ---------                            ---------  ---------  ---------   
                                                                                                
       4,700      5,100     108.51  Gross Sales                   9,300     10,000     107.53   
         330        480     145.45  Less Returns & Discounts        630        985     156.35   
   ---------  ---------  ---------                            ---------  ---------  ---------   
       4,370      4,620     105.72     Net Sales                  8,670      9,015     103.98   
                                                                                                
       2,300      2,400     104.35  Total Cost of Sales           4,500      4,500     100.00   
                                                                                                
       2,070      2,220     107.25     Gross Profit               4,170      4,515     108.27   
                                                                                                
                                    Operating Expenses:                                         
         500        510     102.00     Selling                      980        940      95.92   
         110        110     100.00     R & D                        220        240     109.09   
         500        390      78.00     GENERAL                    1,000        800      80.00   
         200        230     115.00     Administrative               410        430     104.88   
          14         15     107.14     Depreciation                  28         29     103.57   
   ---------  ---------  ---------                            ---------  ---------  ---------   
       1,324      1,255      94.79                                2,638      2,439      92.46   
   ---------  ---------  ---------                            ---------  ---------  ---------   
         746        965     129.36  Operating Income              1,532      2,076     135.51   
                      2             Other Income/-Expense            -8         -6      75.00   
   ---------  ---------  ---------                            ---------  ---------  ---------   
         746        967     129.62  Taxable Income                1,524      2,070     135.83   
         480        490     102.08  Income Taxes                    990        990     100.00   
   ---------  ---------  ---------                            ---------  ---------  ---------   
         266        477     179.32     Net Income                   534      1,080     202.25   
   =========  =========  =========                            =========  =========  =========