Multiple choice technology programming languages

Which of the following statements are correct when using the RETAINstatement?

  1. Variables read with the SET statement will not be affected by it

  2. The RETAIN statement is used when a variable needs to be

  3. Variables will be initialized to the desired value in each iteration

  4. Variables are created during execution

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In SAS, the RETAIN statement prevents variables from being reset to missing at the start of each DATA step iteration. However, it does NOT affect variables read with SET statement - those come from the input dataset and are not subject to RETAIN. The other options are incorrect - RETAIN initializes once (not each iteration), doesn't create variables during execution, and the statement is incomplete.