DATA Step, Macro, Functions and more

Merge datasets and control output records with IN

Reply
Frequent Contributor
Posts: 75

Merge datasets and control output records with IN

[ Edited ]
DATA Merged;
MERGE FileA (IN=A) FileB (IN=B) FileC (IN=C);
BY UIN;
IF A AND (B or C);


RUN;

 

 

Will "IF A AND (B or C);" output (A and B) and (A and C)?

 

Thank you

Super User
Posts: 19,770

Re: Merge datasets and control output records with IN

[ Edited ]

No, that resolves to

 

(A and B)  OR  (A and C)

 

Yours is equivalent to A and B and C

Trusted Advisor
Posts: 1,117

Re: Merge datasets and control output records with IN

 

@apple: In everyday language, the IF condition does select "[both] observations with (A and B) and [observations with] (A and C)." In technical language (and SAS syntax), however, this is described as "(A and B)  or  (A and C)."

Ask a Question
Discussion stats
  • 2 replies
  • 209 views
  • 0 likes
  • 3 in conversation