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 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 19 Nov 2002 14:27:19 -0600
Reply-To:   "Suzanne D. McCoy" <smccoy@LUCIDAN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Suzanne D. McCoy" <smccoy@LUCIDAN.COM>
Subject:   Re: many to many merge
Comments:   To: siva_ganesh@HOTMAIL.COM
In-Reply-To:   <4cd6aa7b.0211191200.73aaf02a@posting.google.com>
Content-Type:   text/plain; charset=iso-8859-1

Since you are just merging by name you are going to get this message. Do you really want the num value from dataset y to overwrite the num value from dataset x? If not, merge by name and num just like you sorted them.

Suzanne

> Hi Everybody, > > I have problem with many to many merge. I have sample code > . > data x; > input name $ num; > cards; > aaa 1 > aaa 2 > bbb 2 > bbb 2 > ccc 3 > ccc 4 > ddd 5 > ddd 6 > ;run; > data y; > input name $ num; > cards; > aaa 9 > bbb 10 > ccc 14 > ddd 15 > ddd 16 > ;run; > proc sort data = x ; > by name num; > run; > proc sort data = y ; > by name num; > run; > data merged; > merge x y(in = b); > by name ; > if b; > run; > > NOTE: MERGE statement has more than one data set with repeats of BY > values. > NOTE: There were 8 observations read from the data set WORK.X. > NOTE: There were 5 observations read from the data set WORK.Y. > NOTE: The data set WORK.MERGED has 8 observations and 2 variables. > NOTE: DATA statement used: > real time 0.04 seconds > cpu time 0.01 seconds > > I have message like merge statement has more than one dataset repeats > of by values. Can any one help what is best method solving these kind > of problems in many to many or one to many merges. > Thanks in advance, > Ganesh

-- Suzanne D. McCoy Lucid Analytics Corp. "Intelligence Unleashed"


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