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 (January 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 13 Jan 2008 09:37:51 -0500
Reply-To:     "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Organization: Internet News Service
Subject:      Re: New problem with data manipulation. Thanks!!!
Comments: To: sas-l@uga.edu

toby dunn wrote: > This is one way: > > Data Need ; > Set Have ; > By ID Visit ; > Retain NewX1 NewX2 NewX3 ; > > If First.Visit Then Do ; > NewX1 = X1 ; > NewX2 = X2 ; > NewX3 = X3 ; > End ; > Else Do ; > NewX1 = NewX1 * X1 ; > NewX2 = NewX2 * X2 ; > NewX3 = NewX3 * X3 ; > End ; > > If Last.Visit Then Output ; > > Run ; > > > Personally Id restructure your data and the problem becomes even > easier to solve:

And if SAS SQL had a new function named PROD, things would be even easier

Proc SQL; create table summary as select id, visit, name, PROD(value) as value from HAVE_VECTOR group by id, visit ; quit;

-- Richard A. DeVenezia http://www.devenezia.com/


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