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 (September 1998, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 23 Sep 1998 14:30:02 -0400
Reply-To:   Schechter Robert RS <robert.schecter@PHWILM.ZENECA.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Schechter Robert RS <robert.schecter@PHWILM.ZENECA.COM>
Subject:   Re: Match merging
Comments:   To: "Khan, Muhammad" <mkhan@OXHP.COM>

Khan,

By using the else, you are saying that there are no duplicates (lname and fname) between files b, c, and d. If your results are not accurate for the data set d, I'll bet that lname fname on d repeats itself on b and/or c.

HTH, Bob

>---------- >From: Khan, Muhammad[SMTP:mkhan@OXHP.COM] > >Hi--- >I am trying to merge three data sets (b,c,d) to the master file i.e dataset >a by lname and fname. when I use the following code. I get the result, but >it is not accurate for the dataset d. I think I am doing something wrong >but I can't figure it out. Any help will be greatly appreciated. > >Thanks > >Muhammad Khan >mkhan@oxhp.com > >/*dataset a=oxhpkhan > dataset b=nwkhan > dataset c=phkhan > datase d=lawrkhan */ > > > >proc sort data=oxhpkhan; >by LNAME FNAME; >run; > >proc sort data=nwkhan; >by LNAME FNAME; >run; > >proc sort data=phkhan; >by LNAME FNAME; >run; > >proc sort data=lawrkhan; >by LNAME FNAME; >run; > > >data all; >merge oxhpkhan(in=a) > nwkhan(in=b) > phkhan(in=c) > lawrkhan(in=d); >by LNAME FNAME; >if a; >if a and b then nw='Y'; >else if a and c then phel='Y'; >else if a and d then lawr='Y'; > >run; > >proc sort data=all; >by LNAME FNAME; >run; >options ls=250 ps=2000 nodate nonumber; >proc print data=all; >id LNAME FNAME; >var phel lawr nw address1 address2 city state county membr_cn prov_id >spec_cod ; >run; >


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