Date: Tue, 16 Jul 2002 09:15:32 -0700
Reply-To: "Huang, Ya" <ya.huang@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Huang, Ya" <ya.huang@PFIZER.COM>
Subject: Re: add a record if a condition is met
Content-Type: text/plain
Here's another way:
data xx yy;
set xx;
if (condition) then output yy; else output xx;
data xx;
set xx yy yy (in=new);
if new then var='new value';
This one needs two steps. It will very likely be less efficient
than Ace's classic solution. Another drawback is that
you may need to sort the final data set.
Regards,
Ya Huang
-----Original Message-----
From: ciro baldi [mailto:baldi@ISTAT.IT]
Sent: Tuesday, July 16, 2002 9:43 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: add a record if a condition is met
dear listers,
i want to add a record to a dataset for each observation if a certain
condition is met.
the new record will be equal to the one on which i check the condition
except for a variable.
the data set is possibly very big.
anyone can help me?
thanks in advance
ciro
|