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 (May 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 1 May 2008 18:38:02 -0700
Reply-To:   newbie <itissandeep@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   newbie <itissandeep@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: OR condition in PROC SQL
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

As suggested I also tried the () around those OR's but for no avail : (

WHERE A.Field1 = B.Field1 AND (A.Field2 =B.Field2 OR A.Field3 =B.Field2 OR A.Field4 =B.Field2 OR ... ... ... A.Field100 =B.Field2)

any other suggestions ?

On May 1, 9:14 pm, newbie <itissand...@gmail.com> wrote: > Hi all, > I'm trying to use PROC SQL to create a new dataset based on two other > datasets. > It looks something like the following: > > Proc SQL; > CREATE TABLE C AS > SELECT * FROM A, B > WHERE A.Field1 = B.Field1 > AND > A.Field2 =B.Field2 OR > A.Field3 =B.Field2 OR > A.Field4 =B.Field2 OR > ... > ... > ... > A.Field100 =B.Field2 ; > > QUIT; > > This is what I want it to do: > I have 100 date fields which are to be compared. If the ID (Field1) > matches in any of the records in A and in B AND the any of the 100 > date fields in the same record in A also matches fixed date field in B > then I want to include the complete record of dataset A + dataset B. > > But apparently I am getting 0 records, though I know there are some > matching. > > Can somebody tell me what is wrong or suggest a better procedure ? > > Thanks a ton


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