Date: Thu, 24 Sep 1998 00:00:28 GMT
Reply-To: LPogoda <lpogoda@AOL.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: LPogoda <lpogoda@AOL.COM>
Organization: AOL http://www.aol.com
Subject: Re: Match merging
You don't tell us what's wrong with your output in respect to "dataset d" but
one possible oversight is that the merge could be a, b, and d or a, c, and d or
a, b, c and d etc. In those cases the option for dataset d will not execute
because of the "else" 's in your code. And looking at it, it's not at all
obvious what you really want if the merge results in a, b, c and d, for
instance. Especially after reading your question.
In article <57D381D888FCD111AB1D00C06D142F58492E04@CTNWKMB01>, "Khan, Muhammad"
<mkhan@OXHP.COM> writes:
>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;
>
>
|