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 (May 2001, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 22 May 2001 12:50:17 -0500
Reply-To:     greg.woolridge@TAP.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Greg  Woolridge <greg.woolridge@TAP.COM>
Subject:      Re: Need help in merging
Comments: To: Sharon Well <peach71_us@YAHOO.COM>
Content-Type: text/plain; charset=us-ascii

Sharon,

You might try using first. variables similar to the following example.

DATA COMBINE; MERGE A B; BY PT VISIT; IF NOT FIRST.VISIT THEN DO; QT=.; QTC=.; PR=.; END; RUN;

It's not fancy code, and I haven't tested it, but I think it should accomplish what you are looking for.

Greg M. Woolridge Manager, Study Programming TAP Pharmaceutical Products Inc. e-mail: greg.woolridge@tap.com phone: 847-582-2332 fax: 847-582-2403

Sharon Well <peach71_us@YA To: SAS-L@LISTSERV.UGA.EDU HOO.COM> cc: Sent by: Subject: Need help in merging "SAS(r) Discussion" <SAS-L@LISTSER V.UGA.EDU>

05/22/01 12:23 PM Please respond to Sharon Well

Hi Everybody I have two datasets as follows

data a

pt visit qt qtc pr

101 1 23 43 54 102 1 23 45 34 103 1 45 23 43

data b

pt visit abnml parm

101 1 ab right atrophy 101 1 ab left atrophy 102 1 nm misc 103 1 nm blah

I want the merged datasets to look like this

pt visit qt qtc pr abnml parm

101 1 23 43 54 ab right atrophy ab left atrophy 102 1 23 45 34 nm misc 103 1 45 23 43 nm blah

When I do a merge using pt and visit as by variables I get the following output

pt visit qt qtc pr abnml parm 101 1 23 43 54 ab right atrophy 101 1 23 43 54 ab left atrophy 102 1 23 45 34 nm misc 103 1 45 23 43 nm blah

I don't want the common values to repeat for the second time in pt 101. I know I cannot accomplish this using merge statements since it retains those values. Any other alternative ways to accomplish this?Thanks in advance.

Sharon

__________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/


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