LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 May 2008 01:58:23 -0700
Reply-To:     shridevikumar@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         shridevikumar@GMAIL.COM
Organization: http://groups.google.com
Subject:      Re: Summarizing columns using Proc report
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Thank you Murugesh for your response.

I found the solution..its actually very simple

The column d which has the row-wise values can be summed up using the below statement available in Proc report. This gives the same total if summed up column-wise also.

ods listing close; ods tagsets.Excel file="..........." style=Normal;

ods tagsets.Excel options(sheet_name='XYZ Report' absolute_column_width='2'); proc report data = Table2 nowd split='#';olumn columns a b c d &e sortId; define a/ order=data Group width=10; define b/ order=data display width=10; define c/ display width=10; define d/ analysis sum width=5; define sortId / order order=data noprint; break after a / summarize ul; run;

ods tagsets close; ods listing;

Hope this solution helps others...

On May 22, 1:41 pm, murugesh <iammurug...@gmail.com> wrote: > On May 22, 2:28 am, shrideviku...@gmail.com wrote: > > > > > Hi, > > > I use a Proc Report statement and ODS Tagset to generate an excel > > sheet. The data displayed in the excel sheet consists of multiple > > columns and multiple rows. The sample code is below. > > > Code > > -------- > > ods listing close; > > ods tagsets.Excel file="..........." style=Normal; > > > ods tagsets.Excel options(sheet_name='XYZ Report' > > absolute_column_width='2'); > > proc report data = Table2 nowd split='#';olumn > > columns a b c d &e sortId; > > define a/ order=data Group width=10; > > define b/ order=data display width=10; > > define c/ display width=10; > > define d/ display width=5; > > define sortId / order order=data noprint; > > break after a / summarize ul; > > run; > > > ods tagsets close; > > ods listing; > > > In the above code which i have written, the column a,b,c,d and e are > > columns displayed in excel. Column e is a macro var and d is the total > > column(row-wise). I need to get a summary of the colmn-wise values.I > > am not sure how to do this using Proc report. Can anyone help me or > > have any suggestions. Thanks in advance. > > Hi, > i suggest ,its not a solution, > in that proc report create output dataset and export into excel using > proc export.. > The code as follows, > proc report data = Table2 nowd split='#' out=output_dataset; > columns a b c d &e sortId; > define a/ order=data Group width=10; > define b/ order=data display width=10; > define c/ display width=10; > define d/ display width=5; > define sortId / order order=data noprint; > break after a / summarize ul; > run; > proc export data =output_dataset outfile='c:\temp.csv' dbms=csv > replace; > run; > Hope this will help... > Regards > Murugesh P


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