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 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 20 Jun 2003 07:29:52 -0400
Reply-To:     Mike Rayle <mike.rayle@WRIGHT.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Rayle <mike.rayle@WRIGHT.EDU>
Organization: Wright State University
Subject:      lag variables
Comments: To: SAS-L@LISTSERV.VT.EDU
Content-type: text/plain; charset=us-ascii

Dear List,

I am trying to reproduce the previous value of the variable A when it is missing. For example, when A is missing in observations 3 and 4, I would like to substitute the value of A from observation number 2. Any suggestions?

Please respond to my email address since I am not currently subscribing to the list.

Thanks, Mike.Rayle@Wright.edu

options ls = 72; data testing; input a b c d e f; retain a ; if a = . then do; a = lag(a); end; datalines; 1 3 5 6 1 3 1 2 3 4 1 4 . 3 5 6 2 3 . 2 3 4 1 2 2 3 4 2 1 2 2 3 2 1 1 2 2 3 3 3 3 4 2 4 3 2 1 3 ; proc print; run;


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