Date: Mon, 16 Mar 2009 12:54:02 -0700
Reply-To: Nancy <nancy0318@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nancy <nancy0318@GMAIL.COM>
Organization: http://groups.google.com
Subject: Is this query right?
Content-Type: text/plain; charset=ISO-8859-1
Tables: Master table--Bless20079 (including duplicate records)
subset table---Dif (including duplicate records)
plan to creat table----rawcheck (still will have
duplicate records)
Purpose: To pick up the records from master tables based on the same
(last name +first name+ collected + result+ lab+lab_number) from the
Dif table.
Method: Pick up the records based on the following conditions
proc sql;
create table rawcheck as
select Last_name, First_name, Birthday, Collected, Result, Lab,
Lab_number
from bless2007
where (last_name in (select last_name from dif)) and (first_name in
(select first_name from dif) )
and (Collected in (select collected from dif)) and (Result in (select
result from dif))
and (lab_number in (select lab_number from dif)) and (lab in (select
lab from dif))
order by lab, last_name, first_name ;
quit;
After i run it, I found some names not in Dif tables showed in the
result.
Thank you!
|