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 (October 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 Oct 2009 12:17:03 -0400
Reply-To:     Norm Weston <nweston@AMGEN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Norm Weston <nweston@AMGEN.COM>
Subject:      Re: macro?

Not 100% sure what you are doing, but try this:

%let maxn = 100;

data BL; set allwks; by dispname; retain Tscore6 Tscore7 cnt; if week='0'; if first.dispname then do; Tscore6=0; Tscore7=0; cnt=0; end;

array dts_(&maxn.) dts_1 - dts_&maxn.; do x = 1 to &maxn.; if dts_(x) eq . then dts_(x)=0; end; Tscore6 = Tscore6 + dts_6 ; cnt = cnt + 1 ; TS6 = Tscore6 / cnt ; Tscore7 = Tscore7 + dts_7 ; cnt = cnt + 1 ; TS7 = Tscore7 / cnt; run;

Obviously you need to set what your maxn value is, but it should get you where you are going. Also, you can set your base number as well, and if the values (dts_) go up in intervals, you can add "by 2" or whatever to your do x = statement.

Good luck.


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