SAS Base Programming for SAS 9 — Question 30
The following SAS program is submittad:
data work.sales;
do year = 1 to 5;
do month=1 to 12;
x+1;
output
end;
end;
run;
How many observations are written the WORK SALES data set?
Answer options
- A. 0
- B. 1
- C. 5
- D. 60
Correct answer: D
Explanation
The correct answer is D because there are 5 years and 12 months, resulting in a total of 60 iterations of the inner loop, hence 60 observations are written to the WORK SALES data set. The other options are incorrect as they do not account for the total iterations produced by the nested loops.