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 (September 2002, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 30 Sep 2002 15:19:12 -0400
Reply-To:     Asheber Sewalem <sewalem@CDN.CA>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Asheber Sewalem <sewalem@CDN.CA>
Subject:      Lag
Comments: To: SAS-L@LISTSERV.VT.EDU
Content-Type: text/plain; charset="iso-8859-1"

Can anybody tell me the opposite of the lag function

Here is the sample data with variables id, yr and x1. I want to create another variable within id, that is x2 as shown below.

Data one;

id yr x1 25 1991 25 25 1992 24 25 1993 30 26 1995 41 26 1996 45 26 1997 39

Here is the desired output id yr x1 x2 25 1991 25 24 25 1992 24 30 25 1993 30 0 26 1995 41 45 26 1996 45 42 26 1997 42 39 26 1998 39 0

Thanks

Asheber


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