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 (June 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 16 Jun 2006 15:43:07 -0400
Reply-To:     Hari Nath <hari_s_nath@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Hari Nath <hari_s_nath@YAHOO.COM>
Subject:      average on rows

Hi all, Iam calcluating means on rows : lets say for the recent 2 months.The sas dataset looks something like shown below, but it can have more number of month variables. My question is, if iam calculating for 10 months, then i have to enter the months in the new variable everytime as shown in the code. Is there is an easier way to do this. Iam trying to think a macro way - but not getting it. Please let me know if any. Thanks hari

>>>>>>>months sas_dataset<<<<<<<<< id_no mar_06 apr_06 may_06 1 100.11 200.23 290.09 2 110.21 300.45 310.08

data new; set months ;

new=mean(apr_06,mar_06); run;


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