Date: Sun, 28 Jan 2007 10:40:58 -0500
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "data _null_;" <datanull@GMAIL.COM>
Subject: Re: Comparing observation in two data sets
In-Reply-To: <1169996870.555883.231800@a34g2000cwb.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Without and example of your data it is difficult for me to determine
exactly what is needed. Perhaps UPDATE could be useful for you. Here
is a completely contrived example that may be helpful.
data work.one;
set sashelp.class;
if mod(_n_,2) eq 1 then age = .;
if mod(_n_,3) eq 1 then weight = .;
run;
proc print;
run;
data work.two;
set sashelp.class;
if mod(_n_,2) eq 0 then age = .;
if mod(_n_,3) eq 0 then weight = .;
run;
proc print;
run;
data work.class;
update work.one work.two;
by name;
run;
proc print;
run;
On 1/28/07, Hari Koduvely <Hari.Koduvely@gmail.com> wrote:
> Dear all,
>
> I have two data sets with same variables. Only thing is that there are
> missing observations in both the data sets which are not the same. How
> do I compare the observations in both the sets, delete the
> observations in one data set which are missing in the other set and
> merge the two sets so that all the non-missiong observations are
> aligned.
>
> Thanks for your suggestions.
>
> Regards,
> Dr. Hari Koduvely
>
|