|
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
|