LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2002, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 13 Nov 2002 16:56:37 +0100
Reply-To:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:   Re: How to have the same flag for each ID
Comments:   To: Action Man <wollo_desse@HOTMAIL.COM>
Content-Type:   text/plain; charset="iso-8859-1"

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 >


Back to: Top of message | Previous page | Main SAS-L page