Date: Thu, 9 Nov 2006 19:25:16 -0800
Reply-To: shiling99@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: shiling99@YAHOO.COM
Organization: http://groups.google.com
Subject: Re: Looking for a function similar tio LAG1... or LAG<n>
In-Reply-To: <3CD71CB2C829034190B365096A4BF02E020591B0@shfexchange.sistemas>
Content-Type: text/plain; charset="us-ascii"
Sorting is not necessary. One way is to use direct access reversely or
point access, then use direct access reversely again. The other way is
to use two set statements with one using direct access or point access.
HTH
Marrufo wrote:
> Hi there,
> I would like to obtain the same result as LAG(-1)(old).... any help?... but I would not like to use the: proc sort data=sasdataset; by descending _n_; and then apply newvar=lag1(oldvar)
>
> Thanks in advance.
> EM
|