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 (May 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 2 May 2002 15:59:49 -0400
Reply-To:     "Braten, Michael (Exchange)" <mbraten@BEAR.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Braten, Michael (Exchange)" <mbraten@BEAR.COM>
Subject:      Re: Last non-Blank value
Comments: To: Sheila Whitelaw <sw75@BOXFROG.COM>
Content-Type: text/plain

Here's my take on it:

data oset; set iset; array months {12} $ 20 dec02 noc02 .................. ;

do i = 1 to dim(months) ; if months(i) ne ' ' then prv= months(i) ; leave; end;

> -----Original Message----- > From: Sheila Whitelaw [SMTP:sw75@BOXFROG.COM] > Sent: Thursday, May 02, 2002 2:24 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Last non-Blank value > > Hi, I need to assign a variable with the last non-blank value of > monthly variables. I have the following code that works fine. I just > wonder if there is a more efficient way to do it. > > data oset; > set iset; > if dec02^='' then prv=dec02; > else if nov02^='' then prv=nov02; > else if oct02^='' then prv=oct02; > else if sep02^='' then prv=sep02; > else if aug02^='' then prv=aug02; > else if jul02^='' then prv=jul02; > else if jun02^='' then prv=jun02; > else if may02^='' then prv=may02; > else if apr02^='' then prv=apr02; > else if mar02^='' then prv=mar02; > else if feb02^='' then prv=feb02; > else if jan02^='' then prv=jan02; > run; > > Thanks for any suggestion.

**************************************************************** Bear Stearns is not responsible for any recommendation, solicitation, offer or agreement or any information about any transaction, customer account or account activity contained in this communication. ***********************************************************************


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