SAS Base (40)

The following SAS program is submitted:

data WORK.PRODUCTS;
Prod=1;
do while(Prod LE 6);
Prod + 1;
end;
run;

What is the value of the variable Prod in the output data set?

A. 6
B. 7
C. 8
D. . (missing numeric)

Check Answer
Answer: B

注解:DO WHILE为循环语句,重复执行该statement和END之间的语句,直到括号内的表达式为False为止。本题中,当Prod的值为6时,执行最后一次Prod + 1,所以程序结束时Prod的值为7。

Leave a Reply

Your email address will not be published. Required fields are marked *