|Date: ||Tue, 5 Feb 2008 19:14:39 -0500|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Frida Aminova <faminova@PACE.EDU>|
|Subject: ||Proc Report Help|
|Content-Type: ||text/plain; charset=us-ascii|
Hello SAS Experts!
I need your help in calculating a Net Assets column using Proc Report based on the SubTotals of Revenue and Expense columns. I have been working with the SAS Support, but my manager suggested that I also draw on your vast expertise. Below is something that I got from working with the SAS Institute Support Team:
proc report data=sashelp.class nowd;
column name age sex height weight;
define age / order;
if _break_=' ' and age=11 then temp=height.sum;
else if _break_=' ' and age=12 then temp1=height.sum;
break after age / summarize;
if _rbreak_=" " then height.sum=temp1-temp;
rbreak after / summarize;
However, it doesn't seem to be working - essentially:
if _rbreak_=" " then height.sum=temp1-temp; --> does not calculate the difference correctly
Below is a snapshot of the output:
Name Age Sex Height Weight
Joyce 11 F 51.3 50.5
Thomas M 57.5 85
11 108.8 135.5
James 12 M 57.3 83
Jane F 59.8 84.5
John M 59 99.5
Louise F 56.3 77
Robert M 64.8 128
12 297.2 472
As you can see, under the height, it does not give a correct value (297.2 - 108.8 = 188.4).
Can you please guide me in where there might be an issue? Or, have another example that I can use to calculate the difference between Revenue and Expense using Proc Report (in this case the height)?
Any help from you will be greatly appreciated.
Pace University - DoIT