Statistical Analysis System (SAS) Programming Certification Practice Exam

Disable ads (and more) with a membership for a one time $2.99 payment

Prepare effectively for the SAS Programming Certification Exam. Access flashcards and multiple choice questions, with hints and detailed explanations. Ace your exam confidently!

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


In an IF-THEN statement, which expression is evaluated first in the provided code?

  1. finlexam>=95

  2. research='A'

  3. project='A' and present='A'

  4. research='A' or (project='A' and present='A')

The correct answer is: project='A' and present='A'

In an IF-THEN statement, the order of evaluation of expressions follows the rules of operator precedence, which determine how different operators are prioritized in logical expressions. The correct choice, regarding which expression is evaluated first, takes into consideration these precedence rules. The expression to evaluate first among the options provided is the one involving logical operators that have the highest precedence. In this case, the logical AND operator has higher precedence than the logical OR operator. Therefore, the expression combining 'project' and 'present' with an AND operator would indeed be evaluated prior to any OR operations. When we look at D, which involves the combination of both AND and OR, the logical AND (involving 'project' and 'present') must be completed before the logical OR (with 'research'). This means that the evaluation of 'project = 'A' and present = 'A'' occurs before any potential evaluation of 'research = 'A' or' along with that compound expression. Consequently, while different conditions may be true, the logical structure calls for the AND condition to be processed first. The other expressions simply consist of individual comparisons that do not involve compound logical structures. Thus, while all choices are valid comparisons, the compound nature of the expression in choice C signifies