|
Hi Wollo,
Q&D and untested:
DATA new (DROP=KeepFlag);
SET old;
RETAIN KeepFlag;
IF (Flag EQ .) THEN Flag = KeepFlag;
ELSE KeepFlag = Flag;
RUN;
There are more ways, e.g. using the (unconditional!) LAG function........
Regards - Jim.
--
Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statist./data man. P.O. Box 1 fax. +31 412 407 080
J.Groeneveld@ITGroups.com 5350 AA BERGHEM, NL www.imrotramarko.com
My computer does what I tell it to do; sometimes it says my instructions are
illegal.
Notice of confidentiality: this e-mail may contain confidential information
intended for the addressed recipient only.
If you have received this e-mail in error please delete this e-mail and
please notify the sender so that proper delivery can be arranged.
> -----Original Message-----
> From: Action Man [mailto:wollo_desse@HOTMAIL.COM]
> Sent: 13 November 2002 16:44
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: How to have the same flag for each ID
>
>
> Hi Fellows;
>
> I have a raw data which looks like this:
>
> ID Name Flag
> 111 ato 87
> 111 bbb
> 111 kkkk
> 111 cccc
> 222 ana 43
> 222 otm
> 222 iod
>
>
> I need the output to look like the following:
>
>
> ID Name Flag
> 111 ato 87
> 111 bbb 87
> 111 kkkk 87
> 111 cccc 87
> 222 ana 43
> 222 otm 43
> 222 iod 43
>
> How do I do that.
>
> Thank you in advance.
> Wollo
>
>
> _________________________________________________________________
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
|