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:   Fri, 3 May 2002 11:17:49 -0400
Reply-To:   Howard_Schreier@ITA.DOC.GOV
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Howard_Schreier@ITA.DOC.GOV
Subject:   Re: Last non-Blank value

Several solutions have been offered.

One thing which has been illustrated but not explicitly stated:

Coding can be easier and less error-prone if one chooses "self-sequencing" variable names.

In this case, I would use something like: M02_01, M02_02, ... M02_12 for the twelve months.

On Thu, 2 May 2002 11:24:15 -0700, Sheila Whitelaw <sw75@BOXFROG.COM> wrote:

>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.


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