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 (October 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 23 Oct 2008 04:51:43 -0400
Reply-To:     Jim Groeneveld <jim.1stat@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim.1stat@YAHOO.COM>
Subject:      Re: Table A exclude data in table B
Comments: To: tammy1207@YAHOO.COM.TW

Hi Tammy,

A non-SQL solution:

DATA Table_A; INPUT Name $ Date; CARDS; Tim 01 Tim 02 Tim 03 Mary 01 Mary 02 Mary 03 Mary 04 ; RUN;

DATA Table_B; INPUT Name $ Date; CARDS; Tim 03 Mary 03 Mary 04 ; RUN;

PROC SORT DATA=Table_A; BY Name Date; RUN; PROC SORT DATA=Table_B; BY Name Date; RUN;

DATA Table_A_no_B; MERGE Table_A (IN=A) Table_B (IN=B); BY Name Date; IF (NOT B); RUN;

PROC PRINT DATA=Table_A_no_B; RUN;

Regards - Jim. -- Jim Groeneveld, Netherlands Statistician, SAS consultant home.hccnet.nl/jim.groeneveld

On Wed, 22 Oct 2008 19:12:02 -0700, tammy1207@YAHOO.COM.TW wrote:

>Hello everyone, > >In table A, it contains entire data of Name and Date. In table B, it >lists the Name and Date which are supposed to removed from table A. >How can I use proc sql or other ways to do the join in order to >eliminate the list in table B? > >Sample: > >Table A > >Name Date >Tim 01 >Tim 02 >Tim 03 >Mary 01 >Mary 02 >Mary 03 >Mary 04 > > >Table B > >Name Date >Tim 03 >Mary 03 >Mary 04 > > >Desire final table > >Name Date >Tim 01 >Tim 02 >Mary 01 >Mary 02 > >I appriciate any assistance you can lend. > >Tammy


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