Multiple choice technology programming languages

The following SAS statement is submitted: data work.sales; do year=1 to 5; do month=1 o 12; x+1; end; end; run; How many observations are written to the WORK.SALES data set?

  1. 0

  2. 1

  3. 5

  4. 60

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

SAS DATA steps write only one observation by default unless an OUTPUT statement is specified within the loop. Even though the loops iterate 60 times (5 years × 12 months), without an explicit OUTPUT statement, only the final observation after the loops complete is written to the data set.