Date: Tue, 21 May 2002 12:33:28 -0700
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Cassell" <Cassell.David@EPAMAIL.EPA.GOV>
Subject: Re: a small question?
Content-type: text/plain; charset=us-ascii
amy <amywang11790@YAHOO.COM> wrote:
> I have 4 columns: a1 b1 c1 d1 in dataset test1
> a1 b1 c1 d1
> 1 2 3 2
> How can I generate following data set?
> a1 a2 b1 b2 c1 c2 d1 d2
> 1 1 2 3 3 6 2 8
You can do this exactly the way you wrote it.
However, it looks like you are trying to perform some sort of
lag function. Are you aware that SAS has lag functions available
in the data step [assuming that your numbers are values of a single
variable, going record-by-record]? Without more information on
what you *really* want to achieve [the big picture, not a simple
formula] we really cannot tell you whether you are doing this the
hard way or not.
David Cassell, CSC
Senior computing specialist