QUESTION 116
The following SAS program is submitted:
data work.totalsales;
set work.monthlysales(keep=year product sales);
retain montnsales {12};
array montnsales {12};
doi=1 to 12;
monthsales{i}=sales;
end;
ent+1;
monthsales{ent}=sales;
run;
The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.
Which one of the following is the result of the above program?
A. The program fails execution due to data errors.
B. The program fails execution due to syntax errors.
C. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.
D. The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations.
答案:D
求问这道题哪里错了?是不是定义数组语句要在retain语句前面?谢谢