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 (August 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 5 Aug 2008 18:15:20 -0400
Reply-To:     Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:      Re: How to add repeated ID - data management
Comments: To: jn_mao@YAHOO.COM


Something like the following might work:

data have; input ID var1 $ var2 $; cards; 1 ER A . ER B . ED C 2 ER D . OP E ;

data want (drop=hold_id); set have; retain hold_id; if not(missing(id)) then hold_id=id; id=hold_id; run;

HTH, Art ---------- On Tue, 5 Aug 2008 13:52:16 -0700, jn mao <jn_mao@YAHOO.COM> wrote:

>Hello SAS-Ls,I have a large data file. Each patient has multiple line of his disease, but each patient has only one ID on the 1st line. I need to add his IDto all his disease lines. How do I add the ID to all lines in SAS code? And patients have differentnumber of lines, some have 3 and some have only 1.My data format is below:ID var1 var21 ER A ER B ED C2 ER D OP EWhat I need is below:ID Var1 var21 ER A1 ER B1 ED C2 ER D2 OP E?Thanks much!Jane

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