1

I am new to SAS and I need to recreate a query I had running using R. The syntax rules may be different in SAS but I dont see where I am going wrong here

Table "Old" columns: A, B, C, D, E

Table "New" columns: A, B, C, D, E

PROC SQL;
                create table delta as
                SELECT *
                FROM New
                WHERE
                (A, B, C)
                IN(
                SELECT (A, B, C)
                FROM New
                EXCEPT 
                SELECT A, B, C
                FROM Old);

QUIT;

My code should find delta rows based on A, B, C variables.

Error Message on comma

WHERE(A, B, C): ERROR 79-322: Expecting a (.

2
  • I don't think SAS supports tuples for IN. Commented Jun 5, 2019 at 15:06
  • Is there an easy replacement I can implement for the same logic? Please let me know. Thanks. Commented Jun 5, 2019 at 15:07

1 Answer 1

1

I'm not in sas but could be that this db don't allow the use of tuple in WHERE IN clause.

in this case you could try refactoring your quesry as an inner join

  SELECT *
  FROM New N 
  INNER JOIN  (
      SELECT A, B, C
      FROM New
      EXCEPT 
      SELECT A, B, C
      FROM Old
  ) T ON  T.A  = N.A 
        AND T.B  = N.B  
          AND T.C = N.C 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.