LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 5 Feb 2008 19:14:39 -0500
Reply-To:   faminova@PACE.EDU
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; compute height; if _break_=' ' and age=11 then temp=height.sum; else if _break_=' ' and age=12 then temp1=height.sum; endcomp; break after age / summarize; compute after; if _rbreak_=" " then height.sum=temp1-temp;

endcomp; rbreak after / summarize; run;

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 6 607.5 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.

Thank you, Frida

Frida Aminova Programmer/Analyst Pace University - DoIT


Back to: Top of message | Previous page | Main SAS-L page