Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: What is the difference between WHERE and IF statements in SAS?
Answer: WHERE is used in data steps and procedures to subset observations, while IF is used within the data step to conditionally execute statements based on a specified condition.

Example:

DATA new_dataset; SET old_dataset; WHERE variable > 50; IF variable2 = 'Yes' THEN new_variable = 'Positive'; ELSE new_variable = 'Negative'; RUN;
Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook