Date: Sun, 5 Feb 2006 16:41:33 -0800
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_;" <datanull@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Charllenging question: How to Pass a Parameter Across the
Records
In-Reply-To: <20060205211022.76517.qmail@web36808.mail.mud.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"
Here is one way to get the next value of renew. Not fancy.
data work.test;
input ID1 ID2 FLAG:$2. PAYMENT BALANCE RENEW;
cards;
1001 101 A1 100 1000 500 100
<<<RECORDS OMITTED>>>
1001 103 A2 1600 0 400 1600
;;;;
run;
proc sort nodupkey data=work.test(keep=id1 id2 renew) out=renew;
by id1 id2;
run;
data work.renew;
set work.renew;
by id1;
nextID2 = lag(id2);
if first.id1 then delete;
drop id2;
rename nextID2=ID2 renew=nextRenew;
run;
data work.test;
merge work.test work.renew;
by id1 id2;
run;
proc print;
run;
|